How to: Use SOSĀ 

This topic applies to:

Visual Studio Edition

Visual Basic

C#

C++

J#

Express

No

No

No

No

Standard

Yes

Yes

Yes

Yes

Pro/Team

Yes

Yes

Yes

Yes

To view dump information for an application written in managed code, you must use a tool called SOS, which is an external component that can be loaded into the debugger. Dump information for native code is displayed in the usual debugger windows, so SOS is not needed for debugging native code.

To use SOS, you must first load the SOS extension into the debugger using the Immediate Window. You then enter commands in the Immediate window, and can view output information there as well. SOS does not use any other debugger windows, such as the Call Stack or Locals window.

SOS can be used to debug managed applications, as well as dump files. To debug a managed application with SOS, you must attach the debugger in both native and managed mode. For more information, see the MSDN BUGSLAYER column entitled SOS: It's Not Just an ABBA Song Anymore.

To get Help on using SOS, use the !help command described below.

To load the SOS debugger extension

  1. First, open the dump file.

    For more information, see How to: Save and Open Dump Files.

  2. On the Debug menu, click Start and wait for execution to break.

  3. In the Immediate window, type the following command:

    .load sos
    

    If the Immediate window cannot find SOS, you may need to specify the full path, which is: %windir%\Microsoft.NET\Framework\<version>\sos.dll

    The version of SOS must match the version of the common language runtime used in the dump file.

To get SOS command Help

  1. After SOS is loaded, in the Immediate window, type the following command !help.

  2. To get more specific information on a command, type, !help command.

To stop an SOS command

  • On the Debug menu, click Stop Evaluation.

See Also

Concepts

Dumps