Life with Visio and other Microsoft Toys!

WP7 Tracking down an error?

leave a comment »

I finally got some feedback on one of my WP7 apps and decided to implement the suggestions. The code compiled well, but failed when I switched pages. I rechecked what I had changed and there was nothing there that would have caused the error. It eventually turned out to be some code I started to work on a few weeks ago.

The error was nice enough to have a StackTrace to give some guidance and the first thing I did was copy it to NotePad so I could disect it. The error was also nice enough to have a LineNumber and LinePosition. Unfortunately, when I looked at the last of my routines mentioned in the StackTrace, I found that it only contains 68 lines, far fewer than the LineNumber given. It took awhile before it dawned on me NOT to look in the C# code behind, but in the associated XAML. Sure enough on the specified line was my error with a nice squigly line under it.

I am still coming to grips with the magic encantations of XAML, but it appears it is not as challenging as it appears.

Of course, the word CRASH in big letters after the failing call would help. It is fun trying to figure out in the Stack Trace where the system wanders down to the “feature” and where it starts to bail out.

John Marshall… Visio MVP


Written by johnvisiomvp

July 31, 2012 at 7:38 pm

Posted in Windows Phone 7, WP7

Tagged with ,

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: