Step Into .NET Framework Code from VS 2005

This post is a duplicate from the istu blog.  The original can be found here.

Microsoft has been nice enough to release the .NET source code as a reference to developers in order to allow them to step into .NET Framework methods.  Up until a couple of days ago, this capability was only available to Visual Studio 2008 users.  John Robbins and Kerem Kusmezer then stepped up and created the .NET Mass Downloader utility which grabs the pdb's from the Microsoft servers and places them on your desktop.  This enables you, amoung many other things, to step into Microsoft .NET Framework source code from within Visual Studio 2005.  Here is how you set it up:

  1. Download the .NET Mass Downloader utility from CodePlex.
  2. Extract the downloaded zip file somewhere.
  3. Start a command prompt and run the extracted NetMassDownloader.exe with the following parameters:  netmassdownloader -d C:\Windows\Microsoft.NET\Framework\v2.0.50727 -output <any drive location where the pdb's will be downloaded to (e.g. C:\ReferenceSource)>
  4. Add the pdb file directory as a location to look for in VS 2005 Options dialouge.  Go to Tools -> Options -> Debugging -> Symbols and add the symbol file location that you specified in step 3.
  5. Uncheck the "Require source files to exactly match the original version" option under Tools -> Options -> Debugging -> General tab.
  6. For each solution you would like to view the .NET source, you need to go to that solution's properties -> Common Properties -> Debug Source Files and add the symbol file location that you specified in step 3.

There, you are now ready to start debugging into your VS 2005 projects within the solution you set up.  Here is an example in action.

Set the break point:

Hit F11 to step into the System.Drawing.Color.FromName method!

That's it!  How cool is that!  VS 2008 users can't have all the fun.