11

I have disabled "Microsoft Symbol Servers" and added path to .NET 4.5 symbols (W:\Debug\RefSrc\Symbols) that I downloaded from http://referencesource.microsoft.com/.

Unfortunately when I force loading of symbols, for example on mscorlib.dll, Visual Studio ignores this folder and proceeds to download symbol file from symbol server. They end up in W:\Debug\SymbolsCache\MicrosoftPublicSymbols and are exactly identical to those in RefSrc.

Is anyone else seeing this behavior ?

My debug settings:

[ ] Enable Just my code
[ ] Enable .NET framework source stepping
[ ] Enable source server support

I had to disable ".NET framework source stepping" because of this.

Community
  • 1
  • 1
Marcin Wisnicki
  • 4,511
  • 4
  • 35
  • 57
  • I'm hitting the same problem with the same settings. Process Monitor shows that VS isn't even trying to access the configured folder. – Julien Lebosquain Jan 18 '13 at 18:30
  • They cannot be the same size. The refsrc copy of mscorlib.pdb is 21 MB. The one you get from the source server is stripped and only 780 KB. Not enough good leads here to post an answer. At least right-click mscorlib.dll in the Debug + Windows + Modules window and click Symbol Load Information. Post what you see. – Hans Passant Jan 18 '13 at 19:03
  • @HansPassant: you're seeing this size difference because you don't have a version of the DLL that comes with source, probably due to security patches: please see http://stackoverflow.com/a/12432029/183367 for more information. The problem isn't that the PDB comes with source or not, that's solved in the question I linked. VS doesn't even try to load the matching PDBs (with source or without, I don't care at the moment) unless they're *already* in the cache, and will always resort to downloading, even with "Microsoft Symbol Servers" unchecked. – Julien Lebosquain Jan 19 '13 at 09:38
  • "unless they're already in the cache" is very weird. You are supposed to add them to the cache yourself. But yes, the fixes and security patches make this a lost cause in general. – Hans Passant Jan 19 '13 at 11:34
  • You don't -- you can specify symbol location folders, which seem to be ignored by VS. Copying them in the cache folder instead works, but isn't a practical solution, especially if your symbols are in a network location. – Julien Lebosquain Jan 21 '13 at 08:58

1 Answers1

5

don't know how you do it in VS 2012 because I never tried it and now I don't have VS 2012, but the way I do it in VS 2010 is the following:

  1. Debug - from main menu
  2. Options and settings
  3. Debugging -> General
  4. Check Enable .NET Framework Source Stepping and uncheck Enable Just My Code
  5. Go to Debugging -> Symbols
  6. Pick a location for "Cache symbols in this directory"
  7. Check the Microsoft Symbol Servers
  8. Ok
  9. Start your application in Debug mode
  10. Go to Debug menu item and choose Windows->Modules
  11. Press F11 to step into Microsoft .NET Framework code (the one that is public, because from as far as I know not all is)

Hope this helps you a bit. I would disable Enable just my code. Also, if I remember correctly, is possible to select from where to load the symbols when you open the Modules window, by right clicking on the item you want to load the sources for.If the pdb file does not correspond to the binary file, it won't load the symbols if the versions are not the same.

lex87
  • 1,276
  • 1
  • 15
  • 33