I have downloaded .net5 from official website, but dotnet
command isn't recognised by my terminal.
Here's what I have found after some research-
my dotnet folder is present in /usr/local/share/dotnet
I used this command but it didn't work sudo ln -s /usr/local/share/dotnet /usr/local/bin/dotnet
dotnet
in terminal it shows zsh: permission denied: dotnet
I also tried this command and it didn't work sudo ln -s /usr/local/share/dotnet /usr/bin/dotnet
dotnet
in terminal it shows zsh: command not found: dotnet
when I open my .cs file in vscode it shows error as The .NET Core SDK cannot be located. .NET Core debugging will not be enabled. Make sure the .NET Core SDK is installed and is on the path.
here's a screenshot for reference
What should I do :(
Had the same(ish) issue after installing .NET 6 broke my current .NET 5 installation.
I fixed it by:
1. removing all files of the current dotnet installation.
This is done by deleting the dotnet
folder located in /usr/local/share/
(Navigate there using Finders 'go to' feature, or just delete it using the terminal)
2. reinstalling the dotnet sdk
download from https://dotnet.microsoft.com
3. adding a symlink to the current dotnet executable.
Arm64 (M1/M2/M3 Macs):
sudo ln -s /usr/local/share/dotnet/dotnet /usr/local/bin/
x64 (Intel Macs):
sudo ln -s /usr/local/share/dotnet/x64/dotnet /usr/local/bin/