question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dotnet: command not found Mac OS X 10.11.4, dotnet-osx-x64.1.0.0-rc2-3002702.pkg

See original GitHub issue

Steps to reproduce

  1. Run the latest released .NET Core pkg installer: dotnet-osx-x64.1.0.0-rc2-3002702.pkg.
  2. Pull up a fresh instance of your preferred shell.
  3. Run dotnet

Expected behavior

dotnet executes and probably prints usage information because no specific command was passed.

Actual behavior

I’m given this output:

zsh: command not found: dotnet

Environment data

dotnet --info output:

shawn ~  dotnet --info
zsh: command not found: dotnet

¯_(ツ)_/¯

normandy:~ shawn$ /usr/local/share/dotnet/dotnet --info
.NET Command Line Tools (1.0.0-preview1-002702)

Product Information:
 Version:     1.0.0-preview1-002702
 Commit Sha:  6cde21225e

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.11
 OS Platform: Darwin
 RID:         osx.10.11-x64

This package was found at https://go.microsoft.com/fwlink/?LinkID=798388, and was not the link specified at the actual instruction guide at https://www.microsoft.com/net/core#macosx.

Verifying the hash:

shawn ~ shasum ~/Downloads/dotnet-osx-x64.1.0.0-rc2-3002702.pkg -a 512
5f00fd91e1bbffe55d091c398913847bab0766ab00987d9164826a1c15f2b05eb8b56f801c0625b75161237dd31eb9180b6468b2bbd9c85077caf2fb4cae6e7a  /Users/shawn/Downloads/dotnet-osx-x64.1.0.0-rc2-3002702.pkg

It’s also worth mentioning that dotnet does, in fact, exist at /usr/local/share/dotnet/dotnet, but there’s definitely no symlink in /usr/local/bin/. While there’s definitely no symlink, the more I read about this issue, the more it seems like that’s intentional. This is most likely actually a duplicate of dotnet/sdk#5193 and highlights the insufficiency of using path_helper for zsh users.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:16 (2 by maintainers)

github_iconTop GitHub Comments

15reactions
shawnrccommented, May 17, 2016

@wenjiangtao The quick fix is to just run ln -s /usr/local/share/dotnet/dotnet /usr/local/bin/, which will get you a working dotnet, but doesn’t change the fact that adding the entry for dotnet in /etc/paths.d/ doesn’t seem to work well for zsh users.

@dasMulli I haven’t made any symlinks to the dotnet binary before, and there was nothing referencing it in /usr/local/bin/ at that point.

Also, in reference to that issue, I think the more sensible option would be to just create a symlink in /usr/local/bin/ - it’s very likely to already be part of a user’s PATH since the project requires you to have brew set up and the latest openssl installed. It seems like zsh doesn’t use path_helper by default, or at least, not in the way that the dotnet maintainers expect it to.

@flyingsky I’m not sure if the installer actually added a symlink to /usr/local/bin/ or if zsh actually runs path_helper on your system, but I was definitely not able to run dotnet after opening a new shell or a new instance of zsh. Or maybe I shouldn’t assume you’re a zsh user, haha.

10reactions
aliozgurcommented, Nov 13, 2020

Adding /usr/local/share/dotnet to the PATH in .zshrc fixed the problem in my case

# Add .NET to $PATH
export PATH="/usr/local/share/dotnet:$PATH"
Read more comments on GitHub >

github_iconTop Results From Across the Web

command not found Mac OS X 10.11.4, dotnet-osx-x64.1.0. ...
1.0.0-rc2-3002702.pkg . Pull up a fresh instance of your preferred shell. Run dotnet. Expected behavior.
Read more >
dotnet: command not found in Mac
So I downloaded NET Core 2.1 SDK for mac and installed it. But when I run the dotnet command from terminal it throws...
Read more >
"dotnet: command not found" after installing the Microsoft .NET ...
NET Core SDK on my MacBook, bash returned "dotnet: command not found" until another symbolic link was created.
Read more >
Install .NET on macOS
In this article, you'll learn how to install .NET on macOS. .NET is made up of the runtime and the SDK. The runtime...
Read more >
Troubleshoot .NET tool usage issues
Could not execute because the specified command or file was not found. Possible reasons for this include: * You misspelled a built-in dotnet...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found