Why is it slow to launch apps on Windows Phone 7 in debug mode?

Summary

Don’t enabled the the option to automatically download debugging symbols from the Microsoft Symbol Servers in Visual Studio when debugging Windows Phone 7 apps.

The Problem

For the past week or so I’ve suffering from a problem that it has been taking a very long time to launch Windows Phone 7 apps in debug mode from Visual Studio.  It was takes up to 10 seconds for apps to launch, but only when the debugger was attached.  Watching the output window I could see the all the Silverlight assemblies loading one by one, taking about a second each.

What was going on?  I hadn’t made any significant changes to my WP7 or the WP tools since I installed the Mango beta.  Why should it all of a sudden slow down like this?

Well, I found the answer when I happened to be debugging some HTTP traffic with Fiddler. I happened to launch a WP7 app while Fiddler was running and saw the following spewed forth into the stream:

image

Visual Studio was trying to download debugging symbols for Silverlight on the Phone, but failing because they are not available.

Although I never explicitly enabled this in Visual Studio, I had recently upgraded to ReSharper 6.  And one of the options in R# is to have it turn on the automatic downloading of symbols from the Microsoft Symbol Servers for you.  I had turned this option on without really thinking of it, when I was debugging a WPF app a little while ago.  Little did I realise it would have such an effect on my WP7 apps.

The Fix

Fortunately the fix is pretty easy just turn off the auto-downloading of symbols in Visual Studio.  This setting can be found in TOOLS –> OPTIONS –> DEBUGGER –> SYMBOLS.

image

Unchecking “Microsoft Symbol Servers” will prevent Visual Studio from trying to automatically download the symbols for WP7 each time the app launched.

Unfortunately this means you are also turning off this functionality for your other projects too.  However if all you need to do is run those projects once with this option enabled for the relevant symbols to be downloaded and cached locally.  Once they are on your local machine, you can simply disable it again.

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s