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 Visio.MVPs.org