Running dotnet run from terminal Mac M1 .net SDK

Viewed 325

I am running Visual Studio 2019 on a MacBook Air M1 and I have installed and downloaded the .NET Core SDK. When I am trying to run an asp.net solution from the terminal with the 'dotnet run' command I get the following message:

Failed to load /opt/homebrew/Cellar/dotnet/6.0.103/libexec/host/fxr/6.0.3/libhostfxr.dylib, error: dlopen(/opt/homebrew/Cellar/dotnet/6.0.103/libexec/host/fxr/6.0.3/libhostfxr.dylib, 0x0001): tried: '/opt/homebrew/Cellar/dotnet/6.0.103/libexec/host/fxr/6.0.3/libhostfxr.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')) The library libhostfxr.dylib was found, but loading it from /opt/homebrew/Cellar/dotnet/6.0.103/libexec/host/fxr/6.0.3/libhostfxr.dylib failed

  • Installing .NET prerequisites might help resolve this problem.

I have installed and downloaded both the .net SDK for 3.1, 5.0 and 6.0. The solution runs fine from the play button in Visual Studio, but it will not work with the command.

I am just wondering if anyone knows if there is a workaround on this?

Thanks in advance!

0 Answers
Related