Debugging a release version of a DLL (with PDB file)

M4N picture M4N · Apr 20, 2009 · Viewed 28.4k times · Source

If I have a DLL (that was built in release-mode) and the corresponding PDB file, is it possible to debug (step-into) classes/methods contained in that DLL?

If so, what are the required steps/configuration (e.g. where to put the PDB file)?

Edit:

If have the PDB file in the same place as the DLL (in the bin/debug directory of a simple console test application). I can see that the symbols for the DLL are loaded (in the Output window and also in the Modules window), but still I cannot step into the methods of that DLL.

Could this be the result of compiler optimizations (as described by Michael in his answer)?

Answer

Marc Gravell picture Marc Gravell · Apr 20, 2009

The pdb is usually (for me at least) detected if it is next to the dll (like with the intellisense xml files).

Alternatively; you'll need a break point after the module has loaded...

At the break-point, bring up the "Modules" window (Ctrl+D,M - or Debug->Windows->Modules). Right click on your dll "Load symbols from", "Symbol path", etc.