Problem installing with dotnet on M1 MacOS architecture

Olivier Paillat 6 Reputation points
2022-03-30T14:34:07.027+00:00

Hello

I have installed :
dotnet-sdk-3.1.417-osx-x64.pkg
on a MAC mini M1 arm64
and I have the following issue when I run dotnet :
/usr/local/share/dotnet/dotnet FootWorkService.dll
Failed to load A, error: dlopen(/usr/local/share/dotnet/host/fxr/6.0.3/libhostfxr.dylib, 0x0001): tried: '/usr/local/share/dotnet/host/fxr/6.0.3/libhostfxr.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/local/lib/libhostfxr.dylib' (no such file), '/usr/lib/libhostfxr.dylib' (no such file)
The library libhostfxr.dylib was found, but loading it from /usr/local/share/dotnet/host/fxr/6.0.3/libhostfxr.dylib failed

There is no equivalent of dotnet-sdk-3.1.417-osx-x64.pkg for arm64 so what should I do ?

Best regards

.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,166 questions
{count} vote

2 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 66,621 Reputation points
    2022-04-02T01:35:26.957+00:00

    Only net 6 has an apple silicon support. You should be able to get 3.1 to run via rosetta. You can only build for intel macs, so any library you use must be intel. It appears a library you are referencing is arm.

    If you need arm support, then you will need to update to net 6.

    0 comments No comments

  2. Jiachen Li-MSFT 32,376 Reputation points Microsoft Vendor
    2022-04-04T09:58:18.747+00:00

    Hi @Olivier Paillat ,
    According to the documentation below, maybe you should try installing an older .net SDK.
    Visual Studio for Mac 8.10 and .NET on Apple Silicon machines
    Best Regards.
    Jiachen Li

    ----------

    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

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.