none
Where is SOS?

    Question

  • I installed the debugging tools (the latest) and when I fire up WinDBG and enter the command .load sos I get:

     

    The call to LoadLibrary(sos) failed, Win32 error 0n2

    " The system cannot find the file specified."

     

    Yet when I search for SOS.dll I find several versions. Where do I set the path so this can be found from WinDbg.

    Kevin

    Friday, June 18, 2010 5:57 PM

Answers

  •  

    2.0 CLR locates in mscorwks.dll while 4.0 CLR locates in clr.dll, .NET3.5 application uses 2.0 CLR.

    The .loadby command takes two parameters, the first one is the extension dll you want to load, the second one is a dll which has been loaded by the debuggee,

    '.loadby sos mscorwks' tells WinDbg to load sos.dll from the path of mscorwks.dll, so sos for .NET 2.0 is loaded. When you debugging .NET 4.0 application, you may use '.loadby sos clr' to load 4.0 sos. 


    Sincerely,
    Eric
    MSDN Subscriber Support in Forum
    If you have any feedback of our support, please contact msdnmg@microsoft.com.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by KevinBurton Friday, June 25, 2010 1:45 PM
    Friday, June 25, 2010 2:33 AM

All replies

  • Hi,

    It's located under .Net folder e.g. %SystemRoot%\Microsoft.NET\Framework\v2.0.50727\sos.dll

    Please note that sos available for different platforms(x86 and x64) so path could vary(Framework\Frameworkx64). To make things easier you could run:

    .loadby sos mscorwks

    this will load appropriate version of sos, in respect of platform and framework version of your app. Please let us know if you have any questions


    Regards
    Friday, June 18, 2010 7:40 PM
  • Make sure that the mscorwks.dll is loaded before uing the loadby command. by the way, if you are debugging .NET 4.0 application, you may  use ".loadby sos clr" to load 4.0 sos.

    See also:

    SOS for .NET 2.0

    SOS for .NET 4.0


    Sincerely,
    Eric
    MSDN Subscriber Support in Forum
    If you have any feedback of our support, please contact msdnmg@microsoft.com.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Monday, June 21, 2010 1:48 AM
  • If i have a .NET 3.5 application but have downloaded .NET 4.0 version of the debugging SDK which has SOS etc. I am finding that I still need to .loadby sos mscorwrks. Does this mean that somehow I am still using the earlier version?

     

    Kevin

    Thursday, June 24, 2010 8:14 PM
  •  

    2.0 CLR locates in mscorwks.dll while 4.0 CLR locates in clr.dll, .NET3.5 application uses 2.0 CLR.

    The .loadby command takes two parameters, the first one is the extension dll you want to load, the second one is a dll which has been loaded by the debuggee,

    '.loadby sos mscorwks' tells WinDbg to load sos.dll from the path of mscorwks.dll, so sos for .NET 2.0 is loaded. When you debugging .NET 4.0 application, you may use '.loadby sos clr' to load 4.0 sos. 


    Sincerely,
    Eric
    MSDN Subscriber Support in Forum
    If you have any feedback of our support, please contact msdnmg@microsoft.com.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by KevinBurton Friday, June 25, 2010 1:45 PM
    Friday, June 25, 2010 2:33 AM