开发者

Trouble debugging WPF [duplicate]

This question already has answers here: XamlParseException after deploying WPF project (10 answers) Closed 8 years ago.

I made a small change to my wpf project and all of a sudden I got the below message.

A first chance exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFra开发者_开发问答mework.dll

Additional information: 'Set connectionId threw an exception.' Line number '10' and line position '7'.

This message didn't give me any idea what the really issue was. Luckily, I only made a small change. I change a combo box to use an itemsource instead of adding the items and I didn't clear the values.

Bottom line is this the debugging didn't give me a clue to what happened. Is there anything that will help debugging these apps.


Welcome to the painful world of WPF debugging. Check out http://geekswithblogs.net/lbugnion/archive/2007/04/02/110622.aspx for a way to make it hurt a little less.


For some more useful links for debugging WPF application, you can have a look at my answer here - Can we Debug Xaml in WPF?

Update:

Tips on how to debug and learn about WPF(Josh Smith): http://joshsmithonwpf.wordpress.com/2007/03/29/tips-on-how-to-debug-and-learn-about-wpf/

Get line numbers of XAML issues (Peter Himschoot)||Wayback Link:

Simply add this to your project file:

<!-- under the <PropertyGroup> tag -->
<XamlDebuggingInformation>true</XamlDebuggingInformation>

Now we at least get line number information on the problem :)

More descriptive XAML exception details (Rob Relyea):
http://rrelyea.spaces.live.com/Blog/cns!167AD7A5AB58D5FE!1625.entry

More on XamlParseException (Laurent Bugnion): http://geekswithblogs.net/lbugnion/archive/2007/03/14/108728.aspx

XAML Runtime Parsing Exceptions (c/o Erno de Weerd): http://blogs.infosupport.com/ernow/archive/2006/02/22/3899.aspx

“Debugging Dynamic XAML in Silverlight” (Julia Lerman): http://blogs.devsource.com/devlife/content/silverlight/debugging_dynamic_xaml_in_silverlight_1.html

How to debug triggers using Trigger-Tracing(Dan Lamping):
http://www.wpfmentor.com/2009/01/how-to-debug-triggers-using-trigger.html

Just use google/StackOverflow to know how to debug specific XAML issues.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜