VS Code error "The .NET CLI tools cannot be located..."

on mac I added the following paths to /etc/paths

/usr/local/share/dotnet
/usr/local/share/dotnet/sdk
/usr/local/share/dotnet/sdk/2.2.101

After you've installed CLI tools (called ".NET SDK"), try restarting VSCode. This will allow VSCode to load the updated $PATH environment variable. VSCode "Reload Window" command will not help in this case.


Sometimes the Visual Studio warning will still persist even after installing the .NET SDK. This is because a link/shortcut/alias needs to be created between the .NET executable install location and the Visual Studio path.

The executable was most likely installed in /usr/local/share/dotnet/dotnet. A symbolic link needs to be created to usr/local/bin for Visual Studio.

To create that link assuming the locations above use this in the Terminal:

$ ln -s /usr/local/share/dotnet/dotnet /usr/local/bin/

For Ubuntu & Snap use this instead:

$ sudo ln -s /snap/dotnet-sdk/current/dotnet /usr/local/bin/