![VS 代码调试器无法在 Ubuntu 操作系统上运行 C# 程序](https://linux22.com/image/1000296/VS%20%E4%BB%A3%E7%A0%81%E8%B0%83%E8%AF%95%E5%99%A8%E6%97%A0%E6%B3%95%E5%9C%A8%20Ubuntu%20%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F%E4%B8%8A%E8%BF%90%E8%A1%8C%20C%23%20%E7%A8%8B%E5%BA%8F.png)
我是 Visual Studio Code 的新手,我将其安装在我的 Ubuntu 机器上并安装了调试器。我可以使用“donnet run”命令正常运行我的程序。我通过将“csharp.fallbackDebuggerLinuxRuntimeId”:“ubuntu.16.10-x64”添加到 settings.json 文件来配置调试器,并将 launch.json 设置为指向我的 dll,如下所示
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceRoot}/bin/Debug/netcoreapp1.1/Code.dll>",
"args": [],
"cwd": "${workspaceRoot}",
"stopAtEntry": false,
"console": "internalConsole"
}
有任何想法吗?
答案1
我找到了问题并修复了它,这是一个语法问题
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceRoot}/bin/Debug/netcoreapp1.1/Code.dll>",
"args": [],
"cwd": "${workspaceRoot}",
"stopAtEntry": false,
"console": "internalConsole"
}
这“>”这一行的末尾有一个问题,它是原始代码的遗留问题