Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug 'unspecified error' on windows phone 7?

'Unspecified error' is a big pain for Windows Phone 7 developers.

It is showed when there are some problems in XAML (missing resource or style) and no useful information is provided about source of the problem:

enter image description here

The question is how to debug such situations and how to find missing styles, xaml issues quickly?

like image 410
sashaeve Avatar asked Nov 04 '22 06:11

sashaeve


1 Answers

That error, along with XAML parse errors, definitely cause some pain.

This isn't very sophisticated, but I've found that the quickest way to debug this type of issue is to make sure everything is checked in to source control and then just copy everything into a separate file. Add chunks back in until you find a chunk that causes the issue, then start working line by line.

Also, in the future, you may want to reexamine your workflow. I find that I hit these types of problems when I'm either writing a ton of code without running it in the emulator or copy/pasting stuff from a blog post without really understanding what it's doing. I have much more success when I take an incremental approach, adding a button, then changing a style, with frequent checks to make sure everything is working.

If you're not using something like Git or Mercurial for source control, definitely look into it. You can make lots of little commits when you get something new working, and then you have an easy fallback if your code breaks.

like image 100
Josh Earl Avatar answered Nov 12 '22 13:11

Josh Earl