What CAUSES the Breakpoint will not currently be hit?
This happens primarily because either the .pdb file is not present, there is a mismatch between the .pdb file and the source, or the .dll file that you wish to be debugged has not been loaded.
Is there a RESOLUTION?
Of course
- Set the configuration option to Debug in the Configuration Manager
- Delete the .pdb files in your bin folders > Recompile the project > Run
- Delete and reload all referenced .dlls
- Delete all .pdbs and .dlls from the bin and obj folder. Reload the .dlls > Recompile > Run
- Close Visual Studio IDE and restart. Rebuild and Run. Surprisingly it works
- Restart your computer. Rebuild and Run. I refer to this as the "Windows Magic"
- Make sure that the XML Element "compilation" tag in your web.config file has an attribute with debug = "true". Only if this is enabled, web apps and services have their .pdb files generated with the .dlls
Another Tip
- 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 reached as far as this. There might be other ways to overcome this. If there are, drop in a comment below. I don't want developers to suffer their debugging process. That's the only way they can spy on every single variable and other declarations.
Happy coding!!