Friday 29 July 2011

The breakpoint will not currently be hit. No symbols have been loaded for this document.

In the Visual Studio IDE, when I set a breakpoint at a line of code, and start debugging, the breakpoint becomes that hollow maroon circle with a warning that says
'The breakpoint will not currently be hit. No symbols have been loaded for this document.'

I've read a bunch of articles about making sure you're running in debug versus release mode, and making sure you deleted your obj AND bin folders. Doesn't always work for me.

While debugging in Visual Studio, click on Debug > Windows > Modules. The IDE will dock a Modules window, showing all the modules that have been loaded for your project.
Look for your project's DLL, and check the Symbol Status for it.
If it says Symbols Loaded, then you're golden. If it says something like Cannot find or open the PDB file, right-click on your module, select Load Symbols, and browse to the path of your PDB.

I've found that it's sometimes necessary to :
stop the debugger
close the IDE
close the hosting application
nuke the obj and bin folders
restart the IDE
rebuild the project
go through the Modules window again

Once you browse to the location of your PDB file, the Symbol Status should change to Symbols Loaded, and you should now be able to set and catch a breakpoint at your line in code.

Also Check the Bin folder of the project and make sure that the dll file is not EXCLUDED from the project. right-click to INCLUDE if excluded.

Most of all: Also click on Build menu, select  Configuration Manager...set Active Solution Configuration to "Debug"

No comments:

Post a Comment