How to: Debug .NET Framework Source
This article applies to Visual Studio 2015. If you're looking for Visual Studio 2017 documentation, use the version selector at the top left. We recommend upgrading to Visual Studio 2017. Download it here.
The latest version of this topic can be found at 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 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
On the Tools menu, click Options.
In the Options dialog box, click the Debugging category.
In the General box, set Enable .NET Framework source stepping.
If you had Just My Code enabled, a warning dialog box tells you that Just My Code is now disabled. Click OK.
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. Click OK.
Under the Debugging category, click Symbols.
If you want to change the symbols cache location:
Open the Debugging node in the box on the left.
Under the Debugging node, click Symbols.
Edit the location in Cache symbols from symbol servers to this directory or click Browse to choose a location.
If you want to download symbols immediately, click Load Symbols using above locations.
This button is not available in design mode.
If you do not choose to download symbols now, symbols will be downloaded automatically the next time that you start the debugging your program.
Click OK to close the Options dialog box.
To load Framework symbols using the Modules window
In the Modules window, 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.
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
In the Call Stack window, right-click a frame for which symbols are not loaded. The frame will be dimmed out.
Point to Load Symbols From and click Microsoft Symbol Servers or Symbol Path.