How do you enable "Enable .NET Framework source stepping"?

For now it is not working if you have SP1 installed. Here are some comment about problem form MS: http://social.msdn.microsoft.com/Forums/en-US/refsourceserver/thread/41388c7b-582b-4e3f-8178-3d38a3c99639


While unfortunately there is a problem with a Microsoft, as Leppie pointed out (and I got the same result see

  • "No Source Available" - Visual Studio Debugging (even when symbols have loaded))

it should be noted that your attempt would fail anyway, since you referenced:

  • Microsoft Symbol Server

instead of:

  • referencesource.microsoft.com/symbols

See the FAQ/Troubleshooting section of Configuring Visual Studio to Debug .NET Framework Source Code


The PDBs for stepping through the source code are only posted for RTM and Service Packs. As such, when security update comes out and it modifies the dll you are trying to debug, it will cause source stepping to not work (that is, you'll get the "No source Available" with a greyed out "Browse to find Source").

However, once you've made all the appropriate settings, you can use the following workaround. The workaround is essentially to find the security updates that caused the dll to change, and then remove them. This has the obvious downside of having those security updates removed on your machine.

Workaround

  1. Identify which dll you want to debug into (e.g. System.Windows.Forms.dll)
  2. While debugging, open the Modules window in Visual studio, find the Version column. If the version is not the RTM or Service pack version, then you'll need to do the workflow. Typically the RTM dll will say "built by: RTMRel". While a dll that was part of a security update will say "built by: RTMGDR". Note the version number (for example 4.0.30319.269 built by: RTMGDR)
  3. Now, we want to find the update that created this version. Do this by searching for the dll and version number at support.microsoft.com/kb/ For example, I did the following google search: site:support.microsoft.com/kb System.Windows.Forms.dll 4.0.30319.269
  4. The search should turn up information about an update. Note the KB number in the address bar. In my example the address was http://support.microsoft.com/kb/2604121, so KB2604121, is what we're interested in.
  5. Go to Control Panel->Programs and Features, and click "View Installed Updates"
  6. Find an update which lists the KB number (you can use the search in the upper right box).
  7. Uninstall that update.
  8. Repeat this process for this same dll until the dll is back to its RTMRel version or SP version. For example, for System.Windows.Forms.dll, I had to remove KB2686827, KB2604121, KB2518870 before it was back to the RTMRel version.

You'll need to do this for each dll within the .NET framework that you care about debugging into.

Once that's done, set a breakpoint within the .net source (for example, go to the Breakpoints tab, say New->Break at Function, and enter System.Windows.Forms.Form.Form) or step into one of the .net methods in that dll.


I have found the answer, I think.

I traced what was happening on Fiddler. It seems only the symbols are currently available, and no source.

When VS tries to load the symbols from the 'referencesource' server it fails (404). As this fails, I think it cannot map to source files on that server.

http://referencesource.microsoft.com/symbols/mscorlib.pdb/ED96A7F38A2940F39B9CA7AD9BC5CB671/mscorlib.pdb

After the above failure, it tries some server called 'msdl' where it finds the actual PDB (but it appears this one have no source code info).

http://msdl.microsoft.com/download/symbols/mscorlib.pdb/ED96A7F38A2940F39B9CA7AD9BC5CB671/mscorlib.pd_

All in all, it appears to be a (temporary) Microsoft issue with their servers.

I am sure I had some source code a while back. But now it is not working.

Edit:

I tried it with various .NET versions, all the same result. :(