2

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 PresentationFramework.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.

akjoshi
  • 15,374
  • 13
  • 103
  • 121
H20rider
  • 2,162
  • 5
  • 29
  • 47

2 Answers2

4

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.

Robert Levy
  • 28,747
  • 6
  • 62
  • 94
  • thanks your help rob. I like the idea of WPF. But so far I am not impressed. the debugging stinks. Designing the UI can be a pain at times and doesnt always appear the same as in VS – H20rider May 25 '11 at 14:23
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – Patrick Hofman Sep 08 '14 at 14:31
3

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.

Community
  • 1
  • 1
akjoshi
  • 15,374
  • 13
  • 103
  • 121