locked
SOS.dll how to debug and profile memory leaks using sos.dll included in the silverlight framework RRS feed

  • Question

  •  Hi all,

    I want to use the sos.dll included in the silverlight 3 version to debug and profile my applciations dump or directly in the visual studio.

    My indertiminate progress bar and other such controls are becoming memory and cpu hog so i want to find the reason why its happening so , searching this i found a great tool included in visual  studio named as sos.dll for doing this so i want to know how to inlude this and use this in  silverlight many people on the net have given how to debug but i am unable to find the first step right.

    I m unable to find how to configure my silverlight appliction to be able to debug unmanaged code as this option is required in order to use sos.dll,

    Sos.dll is used inside the immediate window.

    Could you please help

     

    Friday, October 9, 2009 11:02 AM

All replies

  • In order to use SOS.dll you need to use the debugger in the found here:

     http://www.microsoft.com/whdc/devtools/debugging/installx86.Mspx

     I dont believe sos.dll can be used inside visual studio.  I know it works with the debugger above.

    Friday, October 9, 2009 12:16 PM
  •  Hi bmoore,

    Thanks for the quick reply

    As far as to my knowledge we can use sos.dll from the immediate window inside the Visual Studio or with windbg 

    Here is the link 

    http://msdn.microsoft.com/en-us/library/bb190764.aspx

    In this in the end you will find the lines

    "Use the SOS Debugging Extension by loading it into the WinDbg.exe debugger, which is available from the WDK and Developer Tools Web site, or into Visual Studio. You can execute commands within WinDgb.exe or within the Immediate window of Visual Studio. "

    To load the SOS Debugging Extension into Visual Studio, run the following command in the Immediate window while debugging:

    .load SOS.dll

    If the command is successful, it returns the following message in the Immediate window:

    extension C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\sos.dll loaded
     

    This link provides information on how to use this with Silverlight

    http://blogs.msdn.com/tess/archive/2008/08/21/debugging-silverlight-applications-with-windbg-and-sos-dll.aspx

     i have figured that out but now my problem is that my sos.dll is not loading in the immediate window its complaining that unmanaged debugging is not enabled and i don't know how to enable that in
    silverlight application, in windows application its simple just right click on your solution and click properties and then degug and in configuration check enable unmanaged debugging but i am unable to find that option here in silverlight applciation.

     

    Friday, October 9, 2009 12:39 PM
  • I realize it has been a couple of years, but I'm having the same problem. I can't find out how to allow unmanaged debugging of my silverlight app.

    .load sos.sll returns the error that you've seen.

    Any solution yet?

    Thanks.

    Thursday, July 14, 2011 2:13 PM
  • Try this:

    Goto project properties, Debug tab and then check Enable unmanaged code debugging option.

    Thanks.

    Friday, October 14, 2011 11:00 AM
  • Here's another interesting link you can have a look at...
    Where's your leak at? [Using WinDbg, SOS, and GCRoot to diagnose a .NET memory leak]

    http://blogs.msdn.com/b/delay/archive/2009/03/11/where-s-your-leak-at-using-windbg-sos-and-gcroot-to-diagnose-a-net-memory-leak.aspx

    Hope it may help ;)

    Friday, October 14, 2011 3:22 PM