Installing .NET and runtime on macos M1 does not work

Robin 0 Reputation points
2023-10-11T19:20:44.2833333+00:00

I had the wrong version of .NET installed and removed the .NET SDKs and .NET runtimes.

When I run dotnet --info to confirm, I get this output:

Host:
  Version:      7.0.0
  Architecture: x64
  Commit:       d099f075e4

.NET SDKs installed:
  No SDKs were found.

.NET runtimes installed:
  No runtimes were found.

Other architectures found:
  arm64 [/usr/local/share/dotnet]
    registered at [/etc/dotnet/install_location_arm64]

Environment variables:
  Not set

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

When I download .NET 7.0 SDK (v7.0.402) - macOS Arm64 Installer and run install, the installation goes through without a problem but when I then (even after restart) runs dotnet --info again, or other commands, I cannot verify the installation.

Following the installation guide, does not seem to do the trick for me.

When I ran the wrong version for MacOS M1, I was able to run, and build C# programs, but not run the debugger.

The device is a MacBook Air (M1, 2020) - OS BigSur 11.6, and I run Visual studio code Version: 1.83.0 (Universal).

What should I do?

Developer technologies .NET .NET Runtime
Developer technologies .NET Other
Developer technologies C#
{count} votes

2 answers

Sort by: Most helpful
  1. P a u l 10,761 Reputation points
    2023-10-11T19:30:08.0333333+00:00

    Your host architecture is x64 rather than ARM64 - are you sure you installed the correct installer?:

    https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/sdk-7.0.402-macos-x64-installer


  2. Bruce (SqlWork.com) 77,686 Reputation points Volunteer Moderator
    2023-10-11T19:50:02.14+00:00

    you installed the x64 version and are running dotnet via Rosetta. The x64 version is in the /usr/local/share/dotnet/x64. The arm version is in the /usr/local/share/dotnet folder.

    which dotnet

    Should verify you are using x64 path

    /usr/local/share/dotnet/dotnet --version

    should be the arm version. you probably just need to update your path.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.