【问题标题】:Can't start c# debugger on Visual Studio Code无法在 Visual Studio Code 上启动 c# 调试器
【发布时间】:2016-12-23 19:08:34
【问题描述】:

场景
我正在尝试在 Sabayon Linux 下的 Visual Studio Code 上调试 asp.net 核心项目。当我按下 F5 时,我收到以下消息:

在命令面板中运行“调试:下载 .NET Core 调试器”或打开 .NET 项目目录以下载 .NET Core 调试器

打开命令面板并选择“调试:下载 .NET Core 调试器”什么都不做。

软件版本:
Sabayon linux 16.07
dotnet --version 1.0.0-preview2-003121
Visual Studio Code 1.4.0
VSC 1.3 的 C# 扩展

launch.json

{
"version": "0.2.0",
"configurations": [
    {
        "name": ".NET Core Launch (console)",
        "type": "coreclr",
        "request": "launch",
        "preLaunchTask": "build",
        "program": "${workspaceRoot}/bin/Debug/netcoreapp1.0/myproject.dll",
        "args": [],
        "cwd": "${workspaceRoot}",
        "stopAtEntry": false,
        "externalConsole": false
    },
    {
        "name": ".NET Core Launch (web)",
        "type": "coreclr",
        "request": "launch",
        "preLaunchTask": "build",
        "program": "${workspaceRoot}/bin/Debug/<target-framework>/<project-name.dll>",
        "args": [],
        "cwd": "${workspaceRoot}",
        "stopAtEntry": false,
        "launchBrowser": {
            "enabled": true,
            "args": "${auto-detect-url}",
            "windows": {
                "command": "cmd.exe",
                "args": "/C start ${auto-detect-url}"
            },
            "osx": {
                "command": "open"
            },
            "linux": {
                "command": "xdg-open"
            }
        },
        "env": {
            "ASPNETCORE_ENVIRONMENT": "Development"
        },
        "sourceFileMap": {
            "/Views": "${workspaceRoot}/Views"
        }
    },
    {
        "name": ".NET Core Attach",
        "type": "coreclr",
        "request": "attach",
        "processId": "${command.pickProcess}"
    }
]

}

【问题讨论】:

  • 请尝试删除 ~/.vscode/extensions/ms-vscode.csharp- 中的整个 csharp 扩展目录,然后重新安装扩展。要查看调试器安装的状态,您可以查看输出面板(查看 -> 切换输出)并选择 coreclr-debug 选项以查看任何消息
  • 我做了这些步骤,不幸的是结果相同。 coreclr-debug/install.log 为空。此外,输出面板中没有coreclr-debug 选项。安装 C# 扩展添加Omnisharp Log 选项,但没有coreclr-debug

标签: c# debugging visual-studio-code


【解决方案1】:

BugFinder 的评论帮助我解决了 Debian 9 下 Visual Studio Code 上的相同问题:

  1. 删除 ~/.vscode/extensions/ms-vscode.csharp- 处的整个 csharp 扩展目录,然后重新安装最新版本的 C# 扩展
  2. 在输出面板(View -> Toggle Output)中查看调试器安装的状态并选择“Razor Log”选项
  3. 修复那里发现的所有可能的问题(对我来说,缺少“libunwind8”依赖项,实际修复是运行“sudo apt-get install libunwind8”)
  4. 重启 Visual Studio Code

【讨论】:

    【解决方案2】:

    我在 Windows 操作系统上也遇到了相同类型的问题。 如果您在安装调试器时遇到问题,请尝试此操作:

    1. 点击左下角的设置图标打开用户设置文件
    2. 地址:"http.proxyStrictSSL": false,
    3. 地址:"http.proxy": "https://proxyuser:proxypassword@proxyip:proxyport"

    【讨论】:

      猜你喜欢
      • 2019-04-24
      • 1970-01-01
      • 1970-01-01
      • 2017-05-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多