【问题标题】:Hot reload and debugging breakpoints for dotnet6 in Visual Studio CodeVisual Studio Code 中 dotnet6 的热重载和调试断点
【发布时间】:2022-10-25 15:32:47
【问题描述】:

我尝试了here 所描述的内容,例如将以下内容更新为我的launch.json,然后程序运行。

但是,当我将它们悬停时,我的断点会清空并说No symbols have been loaded for this document

有什么建议么?

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "debug-hot-reload",
            "type": "coreclr",
            "request": "launch",
            "preLaunchTask": "build",
            "program": "dotnet",
            "args": [
                "watch",
                "--project",
                ".",
                "--verbose"
            ],
            "cwd": "${workspaceFolder}",
            "stopAtEntry": false,
            "serverReadyAction": {
                "action": "openExternally",
                "pattern": "\\bNow listening on:\\s+(https?://\\S+)"
            },
            "env": {
                "ASPNETCORE_ENVIRONMENT": "Development",
                "Key": "Value"
            },
            "sourceFileMap": {
                "/Views": "${workspaceFolder}/Views"
            }
        },
        {
            "name": ".NET Core Attach",
            "type": "coreclr",
            "request": "attach"
        }
    ]
}

【问题讨论】:

    标签: c# visual-studio-code .net-core vscode-debugger


    【解决方案1】:

    您可以尝试以下解决方案来解决您的问题:
    添加这行代码:<DebugType>portable</DebugType>给你的“你的项目名称.csproj”文件。这应该对您的问题有所帮助。

    如果这不起作用,请告诉我,让我们看看我们还能做些什么。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-08-10
      • 2020-01-01
      • 1970-01-01
      • 2019-03-19
      • 2019-05-18
      • 1970-01-01
      • 2021-04-03
      相关资源
      最近更新 更多