问题
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