Visual Studio does not allow breakpoints in MVC vi

2019-01-26 09:41发布

Sometimes Visual Studio does not allow me to set breakpoints in MVC views. This has happened to me scores of times, but it doesn't happen for every view and I don't know why.

When you click on the left-hand bar to place a breakpoint, it places a white circle instead of the normal red circle. The message when you hover over it is "The breakpoint will not currently be hit. The source code is different from the original version." It goes on to describe how to allow breakpoints to be hit, but that produces strange results and I don't want that anyways.

If the error is correct, then I want to run the original source code. I don't know what's going on behind the scenes in VS; I try rebuilding and all that but it doesn't help. I'm running in Debug mode in VS 2012.

screenshot of trying to place a breakpoint in vs 2012 MVC razor view

7条回答
走好不送
2楼-- · 2019-01-26 10:01

Make sure your Solution configuration set to Debug not on release.

Thanks

查看更多
登录 后发表回答