Lauching dotnet fails ("dotnet" is not a file of a symlink)

1.5k Views Asked by At

The default vscode configuration for debugging ASP.NET core contains the following:

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

The preLaunchTask fails for me with the following error:

The terminal process failed to launch: Path to shell executable "dotnet" is not a file of a symlink.

I have had this problem before, not on the preLaunchTask but on the main program execution. That I could work around by doing a replace all "dotnet" -> "/usr/bin/dotnet" in ~/.vscode/extensions/ms-dotnettools.csharp-1.**.*/dist/extensions.js + a vscode restart. However, this workaround doesn't work for the preLaunchTask. (And having to do this for every update of that extension in annoying).

Given that I'm a linux noob, it's probably not omnisharp/vscode related but could be something I did wrong in Ubuntu 18.04.

Does anybody know what the error means, and how to fix it? Or even how to debug this problem?

I've already reinstalled vscode, .net5, and my global $PATH env does contain /home/<username>/.dotnet/tools:/usr/bin/dotnet. Other than that I don't know what to do.

1

There are 1 best solutions below

0
On

in tasks.json file change from "type": "process" to "type": "shell"