Silverlight out-of-browser profiling stops with no results
Published 18 December 2012
When profiling an out-of-browser Silverlight application, the profiling session may stop soon after it starts, leaving the application still running. The following message or similar will appear in the ANTS Memory Profiler log file:
[Profiler pipe monitor] WARN RedGate.Profiler.Engine.Startup.Basic.PipeConnection - Rejected a connection attempt from process ID 0x978 'C:\Program Files (x86)\Microsoft Silverlight\sllauncher.exe'
Microsoft had released a security patch to Silverlight in October 2011 that changed the way the out-of-browser Silverlight launcher starts and connects to the profiling API. The sllauncher.exe process seems to Profiler as if it starts and exits immediately, and a new process appears that Profiler will not allow to connect.
Until this problem can be addressed there is a workaround available, which is to profile cmd.exe and launch the Silverlight application in a console session.
- Instead of selecting the option to profile a Silverlight application, use the option to profile a .NET executable.
- Ensure the profile child processes option is enabled
- Set the executable as c:\windows\system32\cmd.exe
- Set the arguments to be /K ""c:\program files (x86)\microsoft silverlight\sllauncher.exe"/emulate:"c:\YourOOBAppFolder\YourOOBApp.xap" /origin:"c:\YourOOBAppFolder" /overwrite"
Where "YourOOBApp" is the folder the XAP resides in and "YourOOBApp.xap" is the out-of-browser Silverlight application
The /K option to cmd will keep the console session and allow ANTS Memory Profiler to attach to any process started in the console session.