Trace WPF System.Windows.ResourceDictionary warning Resource not found

て烟熏妆下的殇ゞ 提交于 2019-12-25 08:47:32

问题


I get below error on output window. I can't find what is the problem?

System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='17' System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='#FF000000'; ResourceKey.HashCode='51639504'; ResourceKey.Type='System.Windows.Media.SolidColorBrush' System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='17' System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='#FF000000'; ResourceKey.HashCode='51639504'; ResourceKey.Type='System.Windows.Media.SolidColorBrush' System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='17'

How to find what's error???


回答1:


If you are familiar with WinDBG you can break the process execution into the debugger on debug output and examine the callstack.

To do so in WinDBG, attach to your process and go to Debug->Event filters

Find a line that says "Debugee output" and click on it On the right click "Enabled" under execution

Type g in the command line to run the debugger and when it breaks on the correct output, use kb to print unmanaged callstack or .loadby sos clr !clrstack to print managed callstack




回答2:


I suggest to search your entire solution for a string like {StaticResource 17}, {DynamicResource 17} or {x:Static 17}. You cannot trace something like that. There's some faulty xaml you have to fix.



来源:https://stackoverflow.com/questions/20652255/trace-wpf-system-windows-resourcedictionary-warning-resource-not-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!