Mobile Zone is brought to you in partnership with:

Developer enthusiast since the young age, my passion is mobile development and, in the last years, I focused on the Windows Phone platform. I'm engaged in many activities for Italian communities by blogging, writing articles and speaking about Windows Phone development. I'm member of the Italian community DotNetLombardia. Since 2012 I'm Microsoft MVP in the Windows Phone Development category and, actually, I work in Funambol as a Software Engineer for the Windows Phone and Windows 8 platforms. Matteo is a DZone MVB and is not an employee of DZone and has posted 26 posts at DZone. You can read more from them at their website. View Full User Profile

How to Deal With the “Unspecified Error” in a Windows Phone Application

08.10.2012
| 1492 views |
  • submit to reddit

While developing and testing a Windows Phone application you may have to deal with a really annoying problem: your application crashes and the only error reported by Visual Studio is a generic Unspecified error.

Visual Studio itself isn’t of any help, because the error is intercepted by the global error handler available in the App.xaml.cs file, so you don’t have a way to understand where exactly the problem occured.

The solution is easy to understand, even if it’s not easy to find: this error is raised usually when your XAML contains a property with an invalid value. For example, when I had to deal with this error I found that, by mistake, the Margin property of a control contained the value 0k, 0, 0, 15, that is obviously not correct (the margin property accepts only numeric values).

To help understanding where your application may contain such an error, keep track of the the time when Visual Studio intercept the “Unspecified error” exception: usually, this error is raised only when you navigate towards a page that has this problem.

Good debugging!

Published at DZone with permission of Matteo Pagani, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)