Additional .NET Framework Source Code Debugging Tricks

With the big announcement today, everyone’s looking at the Framework sources like mad. Make sure you read everything in Shawn Burke’s blog entry before you start. I thought I’d mention a couple of additional hints to help you out.

  1. If you’ve been downloading your symbols with the Microsoft Symbol Server, make sure to delete your cache directory before you start downloading from the new symbol location.
  2. Shawn says you’ll want to check the “Search the above locations only when symbols are loaded manually” in the Options dialog, Debugging, Symbols node. Personally, I think it’s much better to leave that unchecked so that you get the symbols and source downloaded automatically. Yes, there will be some slowdowns on the download, but by getting the symbols and source every time you access the item, you’ll fill up the cache quicker.
  3. If you’re having some trouble getting everything to work, turn on the source server diagnostic messages in the Options dialog, Debugging, General node:

    Also, as you are loading downloading source files by double clicking on them in the call stack window, you can see the path reference location in the status bar.
  4. To get both the new Reference Symbol Server and Microsoft Symbol Server set in your _NT_SYMBOL_PATH environment variable to the following:
    SRV*c:symbolsOSSymbols*http://referencesource.microsoft.com/symbols;SRV*c:symbolsOSSymbols*http://msdl.microsoft.com/download/symbols;
  5. For you advanced hackers out there, I tried like crazy to get SYMCHK and PDBSTR to work for pre-downloading and bulk source extraction working, but with no luck at all. It appears that the WinDBG tools don’t have support for source servers that use http downloads, but the QFE added that support to Visual Studio 2008. (See my article if you don’t know what I’m talking about.)

Hope that helps you out!

[Edit 2/14/08 – Changed symbol path in Step 4 as I pasted it in wrong.]

John Robbins

View Comments

  • Hi John,
    I developed a tool which allows the download of the framework source code without VS2008.
    It also enables me to debug the framework source code under VS2005.
    I want to release the source code and the tool himself under LGPL.
    What is the legal status on the Microsoft side for such a tool?
    As far as i see from the licence, there is no such a term that disallows this.
    I have succedded in mass downloading the source files.
    Contact me for details, so we can publish it together if you want.
    I am now in contact with Shawn Burke about the details.

  • I have the downloaded source code tool, i am just waiting approval for microsoft, please contact me so i can share the mass downloading details with you.
    I am a big fan of your book Debugging Microsoft® .NET 2.0 Applications, so i will for sure share the source code for mass download with you :)

  • Hi John,
    when I try to use SRV*c:symbolsOSSymbols*http://referencesource.microsoft.com/symbols*http://msdl.microsoft.com, Visual Studio does not download the symbols at all.
    Instead when I run WinDbg, I get this error for symbols loading:
    SYMSRV: http://referencesource.microsoft.com/symbols is followed by http://msdl.microsoft.com/download/symbols.
    SYMSRV: Any HTTP store must be the last store in the list.
    When I remove http://msdl.microsoft.com/download/symbols I am able to dowload .NET Framework source files, but then the rest of the symbols does not work.
    How can I enable both scenarios to work in Visual Studio 2008?
    How can one debug .NET source files in WinDbg?
    Thanks!
    Martin Kulov

  • It is not working on my Vista developing machine: I can get the symbols and load them, but I cannot step into the source code (it keeps saying it's not available).
    It all works well on a WIndows XP machine.

  • I'm having the same issue as Alessandro.
    It seems that, on my Vista machine, the (target)directory where the sources are being put, is not created if it does n't exist.
    on XP, there are no problems.
    It is impossible for me to create the target-directory myself in advance, because I do not know what the target-directory will be.

  • All,
    Honestly, I've found the .NET Reference Source stepping to be kind of flaky. To me it feels like the servers hosting the source go up and down all the time.
    I've had some of the same problems you all are mentioning and I don't know how to fix them either. Actually, I do, I use .NET Reflector Pro and that gives me everything without a hassle. Of course, it's commercial so you have to pay for it, but it's worth it.
    - John Robbins

Recent Posts

8-Step AWS to Microsoft Azure Migration Strategy

Microsoft Azure and Amazon Web Services (AWS) are two of the most popular cloud platforms.…

7 days ago

How to Navigate Azure Governance

 Cloud management is difficult to do manually, especially if you work with multiple cloud…

2 weeks ago

Why Azure’s Scalability is Your Key to Business Growth & Efficiency

Azure’s scalable infrastructure is often cited as one of the primary reasons why it's the…

4 weeks ago

Unlocking the Power of AI in your Software Development Life Cycle (SDLC)

https://www.youtube.com/watch?v=wDzCN0d8SeA Watch our "Unlocking the Power of AI in your Software Development Life Cycle (SDLC)"…

1 month ago

The Role of FinOps in Accelerating Business Innovation

FinOps is a strategic approach to managing cloud costs. It combines financial management best practices…

2 months ago

Azure Kubernetes Security Best Practices

Using Kubernetes with Azure combines the power of Kubernetes container orchestration and the cloud capabilities…

2 months ago