VS2010 Slow with Silverlight? Speeding up tips.

(This is a series of unspoken Silverlight best practices, designed to avoid specific pain points when developing Silverlight applications. Refer to this URL http://www.redmountainsw.com/wordpress/?p=1270#list for a complete listing).

Abraham Lincoln famously said

“Give me six hours to chop down a tree and I will spend the first four sharpening the axe.”

Similarly, if you are developing a Silverlight Application of any size, you need to ensure that your edit debug cycles are fast.

Open XAML files using Text Editor By Default

In VS Solution Explorer, Right click on .xaml file, Open With…, Select “Source Code (Text) Editor”, and click “Set as Default”

Only build projects that you are working on.
Go to Build > Configuration Manager… and uncheck any projects that you are not working on.

WCF RIA Services is the culprit in several places

http://forums.silverlight.net/forums/t/194611.aspx

The following registry entries removes the lag in opening XAML files.

HKEY_LOCAL_MACHINESOFTWARE MicrosoftWCFRIAServicesv1.0DisableLiveIntellisense=dword:00000001

HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftWCFRIAServicesv1.0DisableLiveIntellisense=dword:00000001

Do not create a RIA Services Link from the Silverlight app project.

Instead, create a Silverlight DLL project, and have RIA Services Link that one instead. This ought to give you a faster turnaround.

Delete Breakpoints

Doing a “Debug… Delete All Breakpoints” cleared the issue.

Speed up loading symbols when debugging

http://social.msdn.microsoft.com/Forums/en-US/vsdebug/thread/98f50717-c842-4bb1-8676-f64d453f80d1

ou can speed up loading of symbols by doing the following:

1. Verify that you haven’t specified any network shares under Tools->Options->Debugging->Symbols especially to server that do not exist anymore. This will require timeouts.

2. Verify and check that _NT_SYMBOL_PATH or _NT_ALT_SYMBOL_PATH is set to network shares as cg60611 pointed out above.

3. Specify a local cache for symbols in Tools->Options->Debugging->Symbols. After you have downloaded symbols once from network shares you can disable those locations. Symbol loading will go a lot faster after the first attempt.

4. Do not specify any symbol lookup paths at all eithe in environment variable and specify paths in the options page but specify that they be used for manual loading. You can then manually load symbols for modules you care about either via the context menu in callstack or the modules window.

5. VS 2008 SP1 has made a few improvements in this area. It allows for cancelling loading of symbols as it is happening. This will allow you to get to your debug session much faster. Note that this is currently in Beta.

Disable Antivirus

I took 10 seconds off the build time by switching from Trend Micro to Microsoft Defender.


About this entry