.NET 6 and M1 problems when other SDKs are present in the system

If you have M1 Apple device and both .NET 6 and .NET 5 (or .NET Core 3.1) SDKs installed on it, it means that there is dotnet executable from .NET 6, and older SDKs shoved into x64 directory, see more details here. It leads to the following error:

Failed to load A, error: dlopen(/usr/local/share/dotnet/host/fxr/6.0.0/libhostfxr.dylib, 0x0001): tried: '/usr/local/share/dotnet/host/fxr/6.0.0/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.0/libhostfxr.dylib failed
- Installing .NET Core prerequisites might help resolve this problem.

At the current moment, the workaround is (as per the following issue):

  1. Remove all 5.X (and below) .NET SDK's;
  2. Download and install them again from https://dotnet.microsoft.com/en-us/download/dotnet;
  3. Run Rider, go to File | Settings | Build, Execution, Deployment | Toolset and Build and choose proper dotnet CLI (x64 or ARM depends on which one you need right now).

Details and the latest status can be found in the following YT issue: RIDER-71303.

1 comment
Comment actions Permalink

Olga Diakonova Does .NET Core 3.1 and .NET 5 development work on M1 Macs? Am I able to open these "old" projects in Rider and build + debug them? The situation is quite unclear. I know only that .NET 6 is supported.


Please sign in to leave a comment.

Have more questions?

Submit a request