Visual Studio breakpoints not being hit
I know this is not the OPs issue, but I had this happen on a project. The solution had multiple MVC projects and the wrong project was set as startup.
I had also set the configuration of the project(s) to just start process/debugger and not open a new browser window.
So on the surface it looks as if the debugger is starting up, but it does so for the wrong process. So check that and keep in mind that you can attach to multiple processes also.
Silly mistake that left me scratching my head for about 30 minutes.
Solved. Ended up being an incorrect configuration selected in the debug menu. I had mistakenly switched it to a release configuration that could not load the symbols for the document. Switched it to a debug configuration and the breakpoints hit just fine now.
To add on to what Abacus mentioned below, it could also be a web.config transform that is messing with your build. In our case, we have Release configurations that remove the debug
attribute from the web.config's compilation section. Below is a screenshot of an example and Visual Studio's dropdown list of build configurations.
NOTE: Also make sure your Platform is correct along with the configuration. In my case, Dev.Debug|Mixed Platforms
does not correctly build the solution but Dev.Debug|Any CPU
will.
I struggled forever trying to fix this. Finally this is what did it for me.
Select Debug->Options->Debugging->General
Tick Enable .NET Framework source stepping.
(This may be all you need to do but if you are like me, you also have to do the ones stated below. The below solution will also fix errors where your project is loading old assemblies/.pdb files despite rebuilding and cleaning.)
Select Tools -> Options -> Projects and Solutions -> Build and Run,
Untick the checkbox of "Only Build startup projects and dependencies on Run",
Select Always Build from the "On Run, when project are out of date" dropdown.
Enable 'Managed Compatibility Mode'. Go to Tools->Options->Debugging and enable Managed Compatibility Mode.