How to: Debug .NET Framework Source

The most recent version of Visual Studio provides new features for .NET Framework debugging. To debug .NET Framework source, you must have access to debugging symbols for the code. You also need to enable stepping into .NET Framework source.

You can enable .NET Framework stepping and symbol downloading in the Tools / Options dialog box. When you enable symbol downloading, you can choose to download symbols immediately or just enable the option for later downloading. If you do not download the symbols immediately, symbols will be downloaded the next time that you start debugging your application. You also can do a manual download from the Modules window or the Call Stack window.

To enable .NET Framework source debugging

  1. On the Tools / Options / Debugging / General page, check the Enable .NET Framework source stepping option.

    1. If you had Just My Code enabled, a warning dialog box tells you that Just My Code is now disabled. Click OK.

    2. If you did not have a symbol cache location set, another warning dialog box tells you that a default symbol cache location is now set.

  2. On the Tools / Options / Debugging / Symbols page, check the Microsoft Symbol Servers box, or add a new location. Edit the symbol download location in Cache symbols in this directory or click Browse to choose a location.

  3. Decide whether you want to load all possible symbols or just symbols from specific modules. If you want to load all symbols, select All modules, unless excluded. If you want to load only certain modules, select Only specified modules (and then specify the modules).

    The symbols will be downloaded automatically the next time that you start debugging your program.

  4. Click OK to close the Options dialog box.

To load Framework symbols using the Modules window

  1. In the Modules window (while you are debugging, click Debug / Windows / Modules to open), right-click a module for which symbols are not loaded. You can tell if symbols are loaded or not by looking at the Symbols Status column.

  2. Point to Load Symbols From and click Microsoft Symbol Servers to download symbols from the Microsoft public symbols server or Symbol Path to load from a directory where you have previously stored symbols.

To load Framework symbols using the Call Stack window

  1. In the Call Stack window, right-click a frame for which symbols are not loaded. The frame will be dimmed out.

  2. Point to Load Symbols From and click Microsoft Symbol Servers or Symbol Path.

See Also

Other Resources

Debugging Managed Code

Specify Symbol (.pdb) and Source Files in the Visual Studio Debugger