Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dotnet CLI does not correctly evaluate location of SDK's on Mac M1 machine #12731

Closed
mikkelAtVisma opened this issue Nov 26, 2021 · 1 comment

Comments

@mikkelAtVisma
Copy link

Hi,

I have had some issues with making my machine run the .NET Core 3.1 runtime environment, and have recently learned that the dotnet CLI does not find my installed SDK's. When I run dotnet --info I get the output:

dotnet --info
.NET SDK (reflecting any global.json):
Version: 5.0.207
Commit: b2bfcaf

Runtime Environment:
OS Name: Mac OS X
OS Version: 11.6
OS Platform: Darwin
RID: osx.11.0-x64
Base Path: /usr/local/Cellar/dotnet/5.0.207/libexec/sdk/5.0.207/

Host (useful for support):
Version: 5.0.10
Commit: 52296950a9

.NET SDKs installed:
5.0.207 [/usr/local/Cellar/dotnet/5.0.207/libexec/sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 5.0.10 [/usr/local/Cellar/dotnet/5.0.207/libexec/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 5.0.10 [/usr/local/Cellar/dotnet/5.0.207/libexec/shared/Microsoft.NETCore.App]

To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download

The problem is that the CLI looks into the /usr/local/Cellar folder - which only holds the 5.0.207 version, through brew. I have other installed versions in /usr/local/share/dotnet:

➜ ~ cd /usr/local/share/dotnet
➜ dotnet ls
dotnet packs sdk-manifests templates
host sdk shared x64
➜ dotnet cd sdk
➜ sdk ls
3.1.407 3.1.414 5.0.402 6.0.100 dotnet

So, we have many versions in /usr/local/share. To try and circumvent this issue, I created a symbolic link in the /usr/local/Cellar/dotnet/ folder, which points to /usr/local/share/dotnet (This is why we see a dotnet folder in both places, they both point to eachother)

I also set my DOTNET_ROOT path to point at the shared folder which holds the SDK's:

➜ sdk printenv
...
DOTNET_ROOT=/usr/local/share/dotnet/sdk
DOTNET_ROOT_X64=/usr/local/share/dotnet/sdk
...

Does anyone know why my dotnet --info does not find the SDK's localted in /usr/local/share/dotnet/sdk?

Thank you for your time!

@marcpopMSFT
Copy link
Member

Arm64 support for the older runtimes was only added with our November releases. Starting in those releases, x64 installs would install to a separate folder. There are more details available here. Before then, arm64 and x64 would install on top of each other leading to confusing behavior.

Additionally, we find the first dotnet on the PATH and it looks like your cellar version is being found first so you will want to check and reorder your path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants