views:

251

answers:

1

how to use visual studio 2010 performance analyzer with silverlight? Is it possible to do that?

Thanks!

A: 

It sure is possible - though not directly through the UI (although this "sort of works" I wouldn't recommend it for consistent results). The general gist is to follow these steps:

  1. Open a Visual Studio (2010) Command Prompt as an administrator
  2. VSPerfClrEnv /sampleon
  3. VSPerfCmd -start:sample -output:somefile.vsp
  4. VSPerfCmd -globalon
  5. VSPerfCmd -launch:"c:\Program Files (x86)\Internet Explorer\iexplore.exe" -args:""
  6. VSPerfCmd -shutdown
  7. VSPerfClrEnv /off

In this example I've stored a VSP (Visual Studio Profile) called "somefile.vsp" which has profiled an IE session (when IE opens, navigate to your SL project).

You'll have to make sure to disable IE's multiple process mode and that you open the VSP from the directory that has your DLLs and PDBs (so that the profiler can find them) - I recommend associating VSP's with Visual Studio.

More information (including troubleshooting etc) can be found on (disclaimer) my blog: http://www.nachmore.com/2010/profiling-silverlight-4-with-visual-studio-2010/

Oren