Prevent Visual Studio from trying to load symbols for a particular DLL

Visual StudioDebuggingDebug Symbols

Visual Studio Problem Overview


I have Visual Studio 2005 set up to use Microsoft's symbol servers. I also have UltraMon installed, which injects a hook DLL into every process. Whenever I start debugging my MFC application, Visual Studio says:

"Loading symbols for C:\Program Files\UltraMon\RTSUltraMonHookX32.dll..."

for anything from the blink of an eye to several tens of seconds. It's never going to find those symbols... Can I tell it not to bother looking?

(I tried creating an empty RTSUltraMonHookX32.pdb file, but Visual Studio sees that it's not good and carries on looking.)

Visual Studio Solutions


Solution 1 - Visual Studio

You can't do this in a very fine grained fashion but you can disable automatic symbol loading and then manually choose the symbols to load via the Modules window (Debug -> Windows -> Modules).

To Disable Automatic Symbol loading

  • Tools -> Options -> Debugging -> Symbols
  • Check "Search the above locations only when symbols are loaded manually"

Solution 2 - Visual Studio

Also check that you have no "_NT_SYMBOL_PATH" environment variable. If you have this var symbols will load regardless of VS settings.

Solution 3 - Visual Studio

From Visual Studio 2010 onwards, you can go to:

Tools -> Options -> Debugging -> Symbols -> Specify excluded modules

and enter the list of the dlls which take too long to load. I use the full path, given by the Output Window; maybe it accepts wildcards or simple file names.

Solution 4 - Visual Studio

In my case it was because I had set "Enable .Net Source Stepping" to true in

Tools > Options > Debugging > General. 

Rather than setting it to false, I set "Enable Just My Code" to true which automatically set "Enable .Net Source Stepping" to false. It gave me a warning before doing so:

Enabling Just my code automatically disabled .Net framework source stepping

Which suggests Just My Code and .Net source stepping are mutually exclusive.

I hope this helps someone.

Solution 5 - Visual Studio

If you go to Debug Options -> Symbols and then check "load only specified symbols" , it won't load symbols automatically and the debugger works without problem.

Solution 6 - Visual Studio

You can also set up symbol server exclusions which will not be attempted to download in HKEY_CURRENT_USER\Software\Microsoft\Symbol Server\Exclusions or possibly also HKEY_LOCAL_MACHINE\Software\Microsoft\Symbol Server\Exclusions or via a .ini file at %WINDIR%\system32\inetsrv\Symsrv.ini (use the header [exclusions] and put each exclusion on its own line). The exclusions are simple pattern matches, so use msxml5.* for example.

Solution 7 - Visual Studio

Not only the _NT_SYMBOL_PATH can cause this behavior, but for me it was the _NT_ALT_SYMBOL_PATH environment variable that was causing the delays.

(I believe I added this variable when experimenting with WinDbg)

Solution 8 - Visual Studio

In Visual Studio 2013 Pro, if the Microsoft Symbol Server is checked, VS will attempt to load all symbols on their server, causing a lot of extra time.

Solution 9 - Visual Studio

  • Load all symbol packages from MS website manually, put them on a SSD drive for speed :-)
  • If you have a "_NT_SYMBOL_PATH" environment variable, remove the part "http://msdl.microsoft.com/download/symbols" from "SRVe:\symbols*http://msdl.microsoft.com/download/symbols";, so you have only the symbol path where your symbols live preciously downloaded.
  • Now you have support for symbols but they wont be downloaded from MS, but loaded from drive

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionRichieHindleView Question on Stackoverflow
Solution 1 - Visual StudioJaredParView Answer on Stackoverflow
Solution 2 - Visual StudioDenis BakharevView Answer on Stackoverflow
Solution 3 - Visual StudioCalvin1602View Answer on Stackoverflow
Solution 4 - Visual StudioHugo Nava KoppView Answer on Stackoverflow
Solution 5 - Visual StudioNyxView Answer on Stackoverflow
Solution 6 - Visual StudioadzmView Answer on Stackoverflow
Solution 7 - Visual StudioRafView Answer on Stackoverflow
Solution 8 - Visual StudioJim DavisView Answer on Stackoverflow
Solution 9 - Visual StudioMartin.MartinssonView Answer on Stackoverflow