.NET 6 and M1 problems when other SDKs are present in the system Follow
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):
- Remove all 5.X (and below) .NET SDK's;
- Download and install them again from https://dotnet.microsoft.com/en-us/download/dotnet;
- Run Rider, go to
File | Settings | Build, Execution, Deployment | Toolset and Buildand 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.
Please sign in to leave a comment.
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.
.NET Core 3.1 development on M1 with Rider is totally smooth.
What the issue describes is at the moment you have to configure dotnet CLI (x64 or ARM) per solution. In a solution that is configured for dotnetx64, no project may target net 6. So:
Which is understandable, but pain when you are migrating a really large solution from 3.1 to 6.