Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I've installed dot net core on mac, but didn't find "dotnet" command

Today I've just downloaded "dotnet-dev-osx-x64.1.0.0-preview1-002702.pkg" and installed it. After that I tried "dotnet" command in my terminal, nothing printed.

I also tried Spotlight searching, seems nothing found.

Where is this package installed at all?

like image 434
Hind Forsum Avatar asked Jan 17 '17 09:01

Hind Forsum


Video Answer


2 Answers

UPDATE FOR .NET Core 6

It looks like the binary location has been changed to /usr/local/share/dotnet/x64/dotnet but also, the link is broken, since /usr/local/bin/dotnet exists...so I had to delete the old symlink, and replace it like below.

The "new" link would be: ln -s /usr/local/share/dotnet/x64/dotnet /usr/local/bin/

like image 138
NovaDev Avatar answered Nov 15 '22 23:11

NovaDev


The key thing is you need to locate the file dotnet.exe, then create a new Symbolic link to create a new shortcut link to that dotnet.exe file in the usr/local/bin folder. Sometimes you see this error "/usr/local/bin//dotnet: File exists", it means the link already exists in that folder (and it's normally a faulty one), to fix that you need to go to that folder and delete the link.

After you have located the dotnet.exe file, in my case it's in the '/usr/local/share/dotnet/dotnet' folder. Create a new symbolic link for it using this command:

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

Done! You can run the "dotnet" command now...Hope it helps

like image 40
Hung Vu Avatar answered Nov 15 '22 21:11

Hung Vu