且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Visual Studio断点没有被击中

更新时间:2023-02-27 14:18:40

解决了。结束为在调试菜单中选择的错误配置。我错误地将其切换到无法加载文档符号的发布配置。将它切换到调试配置,现在断点就好了。

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.

要添加Abacus下面提到的内容,它也可能是一个搞乱你的构建的web.config转换。在我们的例子中,我们有Release配置从web.config的编译部分删除 debug 属性。下面是一个示例和Visual Studio的构建配置下拉列表的屏幕截图。

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.

注意:还要确保您的平台与配置一致。就我而言, Dev.Debug |混合平台无法正确构建解决方案,但 Dev.Debug |任何CPU 将。

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.