启动 dotnet 失败(“dotnet”不是符号链接文件)

JBS*_*rro 3 process omnisharp visual-studio-code asp.net-core ubuntu-18.04

用于调试 ASP.NET core 的默认 vscode 配置包含以下内容:

"configurations": [
{
    "name": ".NET Core Launch (web)",
    "type": "coreclr",
    "request": "launch",
    "preLaunchTask": "build",
    ...
Run Code Online (Sandbox Code Playgroud)

对我来说失败preLaunchTask并出现以下错误:

The terminal process failed to launch: Path to shell executable "dotnet" is not a file of a symlink.
Run Code Online (Sandbox Code Playgroud)

我以前遇到过这个问题,不是在preLaunchTask主程序执行上而是在主程序执行上。我可以通过替换所有"dotnet"-> "/usr/bin/dotnet"in ~/.vscode/extensions/ms-dotnettools.csharp-1.**.*/dist/extensions.js+ vscode 重新启动来解决这个问题。但是,此解决方法不适用于preLaunchTask. (并且必须为该扩展的每次更新执行此操作,这很烦人)。

鉴于我是一个 Linux 菜鸟,它可能与omnisharp/vscode 无关,但可能是我在 Ubuntu 18.04 中做错的事情。

有谁知道该错误意味着什么以及如何解决它?或者甚至如何调试这个问题?

我已经重新安装了 vscode、.net5,并且我的全局$PATH环境确实包含/home/<username>/.dotnet/tools:/usr/bin/dotnet. 除此之外我不知道该怎么办。

小智 9

tasks.json文件中从 更改 "type": "process""type": "shell"