VS 2022 17.1.3 目前不会命中断点

发布于 01-19 02:53 字数 269 浏览 2 评论 0原文

我正在尝试调试我的 Visual Studio C# Blazor 项目,但是每当我尝试设置断点时,我都会收到错误“当前不会命中断点。未绑定断点。”或“尚未加载任何符号。”我一直能够调试直到最新的视觉版本。我尝试过以下方法:

  • 调试而不是发布模式。
  • 清理和构建解决方案。
  • 选中和取消选中“仅启用我的代码”
  • 仔细检查我的 launchSettings.json

如果有人能给我任何有关如何解决此问题的建议,我将不胜感激。

I am trying to debug my Visual Studio C# Blazor project however whenever I try and set a break point I get the error "The breakpoint will not currently be hit. Unbound breakpoint." or "No symbols have been loaded." I had been able to debug until the latest visual release. I have tried the following:

  • Debug and not Release mode.
  • Cleaning and building the solution.
  • Checking and Unchecking "Enable Just My Code"
  • Double checking my launchSettings.json

If anyone can give me any advice on how to solve this it would be greatly appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

春风十里2025-01-26 02:53:48

我通过在解决方案资源管理器中右键单击项目,转到属性/构建/常规并将“调试符号”设置为“ PDB文件,跨平台的Portable”来解决问题。

I fixed the problem by right-clicking the project in Solution Explorer, going to Properties/Build/General and setting "Debug Symbols" to "PDB file, portable across platforms."

居里长安2025-01-26 02:53:48

对我来说,当我重新保存要放断点的文件时,问题就解决了。

事实证明,该文件在“带有BOM的UTF-8”编码中,进行了一些较小的编辑(例如在末尾添加空白)将编码更改为“ UTF-8”,并且断点开始工作。

For me the issue resolved when I resaved the file where I wanted to put a breakpoint.

Turns out the file was in "UTF-8 with BOM" encoding, doing some minor edits (like adding a blank line at the end) changed the encoding to "UTF-8" and breakpoints started working.

梦明2025-01-26 02:53:48

如果您有多项目解决方案,请转到“解决方案”>“特性。

然后从“单个启动项目”更改为“多个启动项目”。

If you have a multi-project solution, go to Solution > Properties.

Then change from "Single startup project", to "Multiple startup project".

尤怨2025-01-26 02:53:48

我通过仔细检查我的启动集ting.json修复了它。我启用了该项目的调试

I fixed it by double checking my launchSettings.json. I enabled debugging for the project

追我者格杀勿论2025-01-26 02:53:48

尝试添加“ NativeDebugging”:true to 启动settings.json

 "profiles": {
    ...
    "YourProject": {
      "commandName": "Project",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      },
      "applicationUrl": "https://localhost:12345",
      "nativeDebugging": true
    },
    ...
  }

也可以通过
来设置这一点
项目属性 - > debug - > 一般 - > Open Debug启动配置文件UI
- >单击左侧的项目,然后检查启用本机代码调试

Try adding "nativeDebugging": true to launchSettings.json:

 "profiles": {
    ...
    "YourProject": {
      "commandName": "Project",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      },
      "applicationUrl": "https://localhost:12345",
      "nativeDebugging": true
    },
    ...
  }

This can also be set via
Project Properties -> Debug -> General -> Open debug launch profiles UI
-> click your project on the left, then check Enable native code debugging

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文