Install .NET Core with OSX 10.11 installer: dotnet-osx-x64.1.0.0.001598.pkg
open mac terminal:
type dotnet
symbolic links missing on post-installation
Creating links with the following fixes the issue.
ln -s /usr/local/share/dotnet/bin/dotnet /usr/local/bin/
ln -s /usr/local/share/dotnet/bin/csc /usr/local/bin/
dotnet command runs with command line options that have been chosen.
-bash: dotnet: command not found
dotnet --info
output:
None because dotnet command not found.
@cantrellcode You have an old installer. Get the one from the gh repo for your platform: https://github.com/dotnet/cli/tree/rel/1.0.0
The install came from http://dotnet.github.io/getting-started/.
They purport that the best way to install .NET Core on OS X is to use the official PKG package from their site. This installer will install the tools and put them on your PATH.
official PKG package
Perhaps the two organizations are not tightly coupled. Found a "contact" link on that web site and sent feedback to them.
They downgraded the release at that site for the Build conference stating that the experience for devs would be more stable. Use the installers or binaries from the gh repo; however, keep in mind that RC2-nightly is still just a hair unstable for large, complex projects.
same even with latest build, "dotnet: command not found"
Actually after install, i need open new terminal to run command. Then it works. Do NOT add symlink manually.
I fix it with this command line:
ln -s /usr/local/share/dotnet/dotnet /usr/local/bin/
@HagamosVideojuegos Thanks a lot. This works. Im running OSX 10.
@flyingsky opening a new terminal worked, thanks!
@HagamosVideojuegos Worked for me, thanks!
Same issue still exists. Had to manually create the symlink.
i closed my terminal and re-opened. it is working now.
Yeah, same here. Just needed to close terminal and re-open after installing .net core.
Just installed latest dotnet-dev-osx-x64.1.0.0-preview2-003131.pkg
from https://www.microsoft.com/net/core#macos on El Capitan and dotnet
was still not in the path (even after restarting Terminal). Manually adding the symlink resolved it.
This issue is still not resolved today with dotnet...3148.pkg from the official web page. Please fix it.
@blackdwarf Maybe you can take a look?
@pckben Which version of OSX do you have?
@livarcocc sure thing. For all of the people who are failing, a good set of data that would help us with diagnosing is:
/etc/local/paths.d/
path exists and if there is a a file dotnet
in there?Thanks!
Same thing happened with MacOs Sierra, using default Terminal and dotnet-dev-osx-x64.1.0.0-preview2-003148.pkg. Had to manually link to:
ln -s /usr/local/share/dotnet/dotnet /usr/local/bin/
@livarcocc I was on El Capitan when I installed dotnet (but have since upgraded to macOS Sierra) - I used the built-in Terminal, /etc/local/paths.d/
doesn't exist for me.
For Sierra we have a fix for the PKG installer that should've been available. @leecow and @gkhanna79 for the schedule and code movement, that is, what is the version you can use the fix in.
@trajche did you do a clean install of Sierra?
@mythz just to confirm, when you say upgrade you don't mean the clean install of Sierra?
@blackdwarf I did a clean install of Dotnet on a clean installed Sierra just now. Problem solved now with manual symlink so if someone else ends up here can confirm if bug is still there.
@trajche yes, but manual symlink should not be required, which is why I'm trying to figure out where did the fix end up.
The issue is quite simple: in clean installs of Sierra, /etc/paths.d
doesn't exist. The PKG installer has been updated to simply create this path if it doesn't exist.
@blackdwarf Ok - I think restarting Terminal fixes this error. Just tested it without the symlink after restarting terminal and it seems ok. Maybe it was written in the instructions somewhere, but I must have skipped it 馃槩
I too faced the same issue. Terminal was opened before installing the VS Code. Once Installation completes, just restart the Terminal to fix the issue and it has been tested :-)
@HagamosVideojuegos Thanks a lot. This works. Im running OSX 10.
wasn't able to get $ dotnet new bash command to work, closed terminal window and opened a new session, worked fine just as @avatart0ph and others described. good luck all!
@blackdwarf From what I understand the installer is doing something with /etc/local/paths.d/
to get dotnet on the PATH which requires closing and opening the terminal window. This is not mentioned in the installation instructions: https://www.microsoft.com/net/core#macos. It seems it doesn't work in all cases: https://github.com/dotnet/core/blob/master/cli/known-issues.md#users-of-zsh-z-shell-dont-get-dotnet-on-the-path-after-install.
Would it make sense to replace /etc/local/paths.d/
in the installer with ln -s /usr/local/share/dotnet/dotnet /usr/local/bin/
in the installation instructions?
I recently setup CI. There was no way for me to 'close and open the terminal' so I created the symlink.
Still Broken as of 3/19/2017, fixed with:
ln -s /usr/local/share/dotnet/dotnet /usr/local/bin/
@SpireFlux a few questions to help diagnose your issue:
$PATH
which is why the manual ln -s ...
command is required in this case. (not the only possible fix, but the easiest one)./etc/paths.d/dotnet
contain the path to the install location (cat /etc/paths.d/dotnet
should show /usr/local/share/dotnet
)@SpireFlux Thanks, that fixed it for me as well.
I just installed by following the instructions here:
https://www.microsoft.com/net/core#macos
The version i installed: dotnet-dev-osx-x64.1.0.1
I am reading the book C# 7 and .NET Core: Modern Cross-Platform Development - Second Edition.
My macOS is 10.12.4 and installed dotnet-dev-osx-x64.1.0.1
I got same error, @SpireFlux's way fixed it. Thanks!
Is this issue closed because it's OBE by a later version of .NET Core? I ran into this issue today installing the LTS version of .NET Core from the downloads page on the .NET Core website, specifically this download:
I had to download LTS since my mid-2009 MBP doesn't support any OS later than El Capitan.
Would PRs be accepted to fix this issue?
Today still cant now. use this to fix this
ln -s /usr/local/share/dotnet/dotnet /usr/local/bin/
OSX version is Sierra 10.12.5.
l faced the same situation problem after i installed dotnet-sdk-2.0. I had to restart terminal for it to work
ln -s /usr/local/share/dotnet/dotnet /usr/local/bin/
tells me "File exists", however the dotnet command still returns -bash: dotnet: command not found
Restarting the terminal also, does not work
ln -s /usr/local/share/dotnet/dotnet /usr/local/bin/
It works for me with latest installer dotnet-sdk-2.0.0-osx-gs-x64.pkg
dotnet --info
result:
.NET Command Line Tools (2.0.0)
Product Information:
Version: 2.0.0
Commit SHA-1 hash: cdcd1928c9
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.13
OS Platform: Darwin
RID: osx.10.12-x64
Base Path: /usr/local/share/dotnet/sdk/2.0.0/
Microsoft .NET Core Shared Framework Host
Version : 2.0.0
Build : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d
close, reopen terminal not work for me, but soft link works
dotnet info shows
.NET Command Line Tools (2.1.4)
Product Information:
Version: 2.1.4
Commit SHA-1 hash: 5e8add2190
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.13
OS Platform: Darwin
RID: osx.10.12-x64
Base Path: /usr/local/share/dotnet/sdk/2.1.4/
Microsoft .NET Core Shared Framework Host
Version : 2.0.5
Build : 17373eb129b3b05aa18ece963f8795d65ef8ea54
Hit this same problem. Installed from recommended installer package. Had to follow the steps in the first post on this issue to get it working. CLI version info below
Product Information:
Version: 2.1.4
Commit SHA-1 hash: 5e8add2190
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.13
OS Platform: Darwin
RID: osx.10.12-x64
Base Path: /usr/local/share/dotnet/sdk/2.1.4/
Microsoft .NET Core Shared Framework Host
Version : 2.0.5
Build : 17373eb129b3b05aa18ece963f8795d65ef8ea54
Experienced this today on macOS, using the instructions here:
https://www.microsoft.com/net/learn/get-started/macos
Resolution was as mentioned above:
ln -s /usr/local/share/dotnet/dotnet /usr/local/bin/
CLI version info:
.NET Command Line Tools (2.1.4)
Product Information:
Version: 2.1.4
Commit SHA-1 hash: 5e8add2190
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.13
OS Platform: Darwin
RID: osx.10.12-x64
Base Path: /usr/local/share/dotnet/sdk/2.1.4/
Microsoft .NET Core Shared Framework Host
Version : 2.0.5
Build : 17373eb129b3b05aa18ece963f8795d65ef8ea54
Wow, nearly 2 years and this still doesn't work? Why is this closed? Just installed from
https://www.microsoft.com/net/learn/get-started/macos
Close terminal and re-opened., dotnet is not in path
@greggman did you check any linked issues / comments?
do you use zsh? (oh-my-zsh installer)
Okay, sorry, it's the zsh or rather maybe the oh-my-zsh issue. Sorry I missed that.
I am using oh-my-zsh and manually symlinking makes it work.
I had the same issue with dotnet-sdk-2.1.300-osx-gs-x64.pkg
installing to /usr/local/share/dotnet
and not modifying the PATH.
High Sierra 10.13.3, using Bash. Creating the symlink ln -s /usr/local/share/dotnet/dotnet /usr/local/bin/
fixes this issue.
echo $PATH
/Users/samyun/chromedriver:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/samyun/.npm-global/bin
This is still an issue as of 8/6/2018 (dotnet-sdk-2.1.302-osx-gs-x64.pkg).
Adding dotnet to my PATH resolved the issue (High Sierra)
export PATH=/usr/local/share/dotnet:$PATH
New terminal worked for me. TY for this thread.
@djacobus your solution worked for me. Thanks holmes!
Still having to add symlinks.
For OS X (10.12.6) I had to use @HagamosVideojuegos workaround . This was for the latest installer of https://download.visualstudio.microsoft.com/download/pr/8a8072ea-07b3-4e31-8c2b-db56c9dc0b3c/5ef3a090b5e1b7f7c80338249d29f2b3/dotnet-sdk-2.1.403-osx-gs-x64.pkg from https://www.microsoft.com/net/learn/dotnet/hello-world-tutorial . So, why was this issue closed? Thanks. #hacktoberfest
I'm surprised that nobody mentioned the path_helper
introduced in recent macOS. path_helper
respects /etc/paths.d/dotnet
, in which is the /usr/local/share/dotnet/dotnet
binary
add the following line to your shell profile
eval `/usr/libexec/path_helper -s`
Wow...surprising that this is still an issue since 2016 (that you have to run ln -s /usr/local/share/dotnet/dotnet /usr/local/bin/
).
They should at least add it to the install instructions.
Still an issue in June 2019
Add export PATH=/usr/local/share/dotnet:$PATH
to ~/.zshrc
if you're on Zsh or ~/.bash_profile
if you're on Bash.
Uninstalling manually and reinstalling dotnet SDK with homebrew worked for me.
"brew cask install dotnet-sdk-3.1.100"
I am using Catalina.
Not sure why this is closed =/, 4 years on it's still an issue (the accepted solution does work).
VS Code instructions tell you to use the installer package and it doesn't setup the path properly for you or symlink it to /bin.
Homebrew is a better option but it's not what the prompt in vs code tells you to do...
Most helpful comment
I fix it with this command line:
ln -s /usr/local/share/dotnet/dotnet /usr/local/bin/