Wednesday, July 14, 2010

Silverlight Profiling

You can do profiling of your silverlight 4 applications. Inside VS 2010 you will not be able to do it. You have to fire up VS Command Prompt and run following commands to perform profiling.
  1. VSPerfClrEnv /sampleon
  2. "C:\Program Files\Internet Explorer\iexplore.exe" http:\\youhostname\pathtosilverlightapplication
  3. VSPerfCmd /start:sample /output:ProfileTraceFileName /attach. You can Identify Process ID using Task Manager.
  4. Run you scenarios.
  5. VSPerfcmd /detach
  6. VSPerfCmd /shutdown
  7. VSPerfClrEnv /off

You can open your ProfileTraceFileName file in VS 2010 and see you code execution paths. But before you open you need to provide paths to MS Symbol Server and also path to your profiling application's pdb files to load symbols of your application. You can do this using VS 2010's menu "Debug->Settings", In settings option window, select symbols under Debug category. Ensure Microsoft Symbol server is selected, and also add path to your pdb files. After doing this, if you open Trace file you can see your code execution paths.

No comments: