Single-Stepping Through MS Code

Microsoft allows you to single-step through the framework code via Visual Studio 2008/10. To enable this under 2010 is trivial. Do the following:

Within Visual Studio, open Tools > Options…. The following window displays.

Visual Studio Options

Browse to Debugging – Symbols. Make sure the Microsoft Symbol Servers checkbox is checked, and indicate a place on your drive where you would prefer symbol and source information downloaded from Microsoft’s symbol server:

Symbols

Click on the General sub-node under Debugging, select the Enable .NET Framework source stepping checkbox. You will then be presented with a number of confirmation dialogs. Click OK to all of them.

Select the Enable .NET Framework source stepping checkbox.

Set a breakpoint in your code. When you run the code (and this is the only real odd part of this whole experience), view the call stack. Right-click a frame on the stack, select Load Symbols From > Microsoft Symbol Servers.

Set a breakpoint in your code.

A modal (or two) dialog boxes may pop up, representing the download of the modules from the symbol server. Upon completion, the grayed out frames in the callstack should now be black, meaning they may be double-clicked to open the actual source code.

Note: Not all of the code will have associated symbols. If symbols do not exist, you will get a “No Source Available” window opened from within Visual Studio, asking if you wish to see the disassembly instead.


Related posts