Subscribe Now: Feed Icon

Wednesday, May 9, 2012

A day without the Debugger

On Sunday morning I found out the Visual Studio 2010 Debugger has stopped working for me. It wasn’t isolated to a single project or technology. Attach to process didn’t work in Silverlight and running Unit Tests in debug mode gave the usual “The breakpoint will not be hit. No symbols have been loaded for this document.”:


Visual Studio was in Debug mode just didn’t pass through any breakpoint (just to check that the Unit Tests used the latest build I added Assert.Fail and the Unit Test failed).

So, first I thought to give myself a challenge and try to work without a debugger. All was of the good until I had a small and stupid bug that I was sure I could just solve using Unit Tests, but the server side worked and I could see the data passing from the client using Fiddler. It didn’t help that in the front of my mind I just knew that with a Debugger this will be solved in minutes. So I dropped the challenge and started investigating the problem.


First I went through the usual suspects:


  • Restarted the computer
  • Enabled Just My Code (Options-> Debugging –> General), since I like having symbol debugging it was turned off
  • Reset the setting using Devenv.exe /resetsettings 
  • I decided against using Devenv.exe /SafeMode (but next time I will use it)

I was very close to trying the repair on the windows Control Panel. But then I noticed that while the debugger didn’t break on any breakpoint it did show a few BadImageFormatException exceptions being thrown, setting Visual Studio to break on those exceptions (Debug menu –> Exceptions… (or Ctrl+D+E) –> Find: “BadImageFormatException” and checking the thrown:


Running it again:

System.BadImageFormatException occurred
  Message=Could not load file or assembly 'dbghelp.dll' or one of its dependencies. The module was expected to contain an assembly manifest.
       at System.Reflection.AssemblyName.nGetFileInformation(String s)
       at System.Reflection.AssemblyName.GetAssemblyName(String assemblyFile)
  InnerException: System.BadImageFormatException
       Message=Could not load file or assembly 'dbghelp.dll' or one of its dependencies. The module was expected to contain an assembly manifest.

Or just the Dlls:

  • dbghelp.dll
  • DDConfig.dll
  • LanguagePackage.dll
  • Microsoft.VisualStudio.Coverage.Symbols.dll
  • Microsoft.VisualStudio.ProgressionIcons.dll
  • Microsoft.VisualStudio.QualityTools.RecorderBarBHO100.dll
  • pidgenx.dll
  • SqlTDiagN.dll
  • SqlToolsVSNativeHelpers.dll
  • symsrv.dll

Searching the file system for one of them dbghelp.dll,the icon for the DLLs was for dotPeek which got me thinking about uninstalling JetBrains early access tools dotPeek and dotCover (after closing VS) – just to be sure it wasn’t them…

Trying Debug again and everything worked.


The weird part is trying to reinstall those apps (with the exact same MSIs) didn’t reproduce the problem. Looking back I remember restarting my computer before all this started but even restart won’t reproduce the problem.

Another case for the “computer's nondeterministic nature”…



Peter Gfader 's .NET Blog: VS2010 - Debugging not working

StackOverflow: debugging is not working in my visual studio 2010

MSDN Forums: Debugger not working on Visual Studio 2010