Windows Phone 7 beta: Application Crashes With No Exception In Visual Studio

Windows Phone 7 beta: Application Crashes With No Exception In Visual Studio

Here’s a simple scenario: You have some code that gets invoked during application startup (for example creating instances of your view model, loading data from isolated storage etc). Whilst developing this code you place breakpoints in this code. When you run your application in the debugger the breakpoints get hit, you step through the code and it all works as expected. However, when you press F5 to continue, the application just terminates and Visual Studio stops debugging…. you’re left thinking what the?

What I suspect your seeing is the implementation of one of the Windows Phone 7 requirements around launching. If you read the Windows Phone 7 Application Certification Requirements you will see that 5.2.1 talks about launch time.

5.2.1 Launch Time
a. The application must render the first screen within 5 seconds after launch.
To meet this requirement, Microsoft recommends that the application provides a splash screen image in a file called SplashScreenImage.jpg in the root of the XAP package.
b. Within 20 seconds after launch, the application must be responsive to user input.

If you either allow your application to launch without breakpoints, or you quickly step through your breakpoints you should see that your application loads without any issues. If you stop the application on a breakpoint for a good 30 seconds, your likely to see your application terminated. This also applies to when you return to your application after it has been Tombstoned (ie Deactivated and then terminated in the background) – in this case you need to make sure you restart your application from Visual Studio quickly otherwise it will be terminated completely and you’ll have to restart your debugging again.

Leave a Reply

Your email address will not be published. Required fields are marked *