首页 > 解决方案 > Visual Studio 2019 break point is getting hit

问题描述

I am working on Dotnet Core + Angular application with Visual Studio 2019. After publishing code in release mode and deployed on IIS. When I changed the code to debug and tried to debug something the breakpoints are not getting hit on any controller. Does anybody ever faced this problem, it would be helpful to have any solution on this. Here is my project properties

enter image description here

标签: debuggingvisual-studio-2019

解决方案


Visual Studio 2019 断点受到打击

这确实是一种非常奇怪的行为,我建议您可以尝试以下建议来解决您的问题:

建议

1)右键单击​​您的项目-->属性-->构建-->高级--> 更改Debugging InformationFull.

2)确保您使用IIS ExpressGoogle Chrome或更改为使用IE来调试您的项目

3) Tools --> Options--> Debugging--> Symbols--> 选择Microsoft Symbol Servers--> 点击Load All Symbols

4)关闭VS Instance,删除.vs解决方案文件夹下的隐藏文件夹binobj文件夹,然后重新启动您的项目再次测试。

更新 1

根据您的问题,JS向Core发送请求,无法进入断点,您可以尝试以下步骤:

1)在--> --> -->Javascript Debugging for Asp.Net(Chrome,Edge and IE)下启用选项ToolsOptionsDebuggingGeneral

2)如果您尝试在cshtml上调试js,您应该将这些js移动到单个javascript文件中,然后在cshtml中引用这样的js文件。你可以参考这个链接

希望它可以帮助你。


推荐阅读