15

I'm having an issue with loading symbols on my ASP.NET MVC project. The first time I load visual studio and debug my project, symbols are loaded in roughly 2 seconds. I then end the debug session, make a code modification, and debug again, and the symbol load time is about a minute. Based on the research I have done, here are some applicable settings on my machine/VS:

In Options/Debugging/Symbols/Symbol file locations, "Microsoft Symbol Servers" is unchecked, and there are no additional locations.

Options/Debugging/Symbols/Cache symbols in this directory is "G:\Symbol Cache". I did click "Load all symbols" and I have inspected that directory and I see lots of symbols.

Just my code is enabled.

The _NT_SYMBOL_PATH and _NT_ALT_SYMBOL_PATH environment variables are not defined on my machine.

Options/Debugging/Symbols/Automatically load symbols for is set to "Only specified modules", with no modules specified.

I have tried both debug and release builds, with identical results. Ctrl + F5 loads the site almost immediately.

John Saunders
  • 160,644
  • 26
  • 247
  • 397
Jason Fry
  • 1,204
  • 12
  • 24
  • I'm experiencing this problem as well and I hope someone come up with an answer... – Trap Jan 01 '13 at 14:27
  • I "fixed" the issue by uninstalling VS2012 and all dependencies, deleting the VS2012 folder in program files, re-installing VS2012, and caching all MS symbols from the symbol server (options -> debugging -> symbols). Best of luck to you. – Jason Fry Jan 01 '13 at 19:21
  • 2
    wow, solution by user961969 will only take couple of hours :) – dotsa Feb 12 '13 at 20:07

4 Answers4

12

I too had this problem, the cause was that I had accidently enabled the "Microsoft Symbol Server"

You can disable it by going to Tools > Options > Debugging > Symbols and uncheck the "Microsoft Symbol Server"

Now it loads just as fast as it used to.

Peter Taylor
  • 121
  • 1
  • 3
6

I too had this problem and noticed that it was mostly related to 3rd-party assemblies acquired via NuGet. In these cases, Visual Studio was trying to load PDBs from paths that apparently existed on the original author's machine (i.e. D:\OriginalAuthor\MyVisualStudioProjects\AwesomeNuGetPackage) but on my machine the same path referred to an optical drive. I then discovered via Command Prompt that if you tried to change directory to an optical drive that didn't have a disc in the tray, it took a very long time (~30 seconds) to fail. With this in mind, my solution was to simply place a DVD in the tray. At that point Visual Studio was able to very quickly determine that the path didn't exist, skip loading the PDB, and go straight into debug.

So, if Visual Studio is taking a long time to load symbols, watch the Output window for the paths it's trying to access and verify that you can quickly access (or quickly fail to access) those paths yourself via Command Prompt.

This brings up an interesting question about security/privacy--apparently Visual Studio is storing the absolute path of the original PBD within the assembly. I suppose this isn't a super critical issue, but from a privacy perspective I don't really want my absolute filesystem paths being exposed to the public without my knowledge.

Mike
  • 7,500
  • 8
  • 44
  • 62
  • 1
    Hahaha... "to fix my problem debugging in Visual Studio, I put a DVD in the tray". +1, this made my day :) – Tobias J Mar 02 '15 at 22:34
  • FWIW, it looks like you can prevent VS from trying to load symbols for specific DLLs under Tools -> Options -> Debugging -> Symbols, then click on "Specify excluded modules". – Tobias J Mar 03 '15 at 18:35
  • I don't know why but the exact opposite worked for me. I took an unrelated DVD out. – EnE_ Mar 12 '15 at 05:31
  • This NuGet and PDB is completely lame comparing to the fast and comfortable Java + Maven solution. – xmedeko Nov 24 '15 at 21:22
4

Just try this Debug -> Delete All Breakpoints. Its works on me.

Rousonur Jaman
  • 1,183
  • 14
  • 19
0

I had 2 .dll's giving me grief that I didn't need to debug that started taking minutes to load. The afore mentioned solutions didn't help. So I went to Options -> Debugging -> Symbols and under the radio button for "All modules, unless excluded" click on "Specify excluded modules" link. Then type the .dll's that are causing issues.

pauzinho
  • 23
  • 5