efcore: Failed to load 6.0.0-preview.3.21201.4/libhostfxr.dylib, no suitable image found. Mac M1
File a bug
Remember:
- Please check that the documentation does not explain the behavior you are seeing.
- Please search in both open and closed issues to check that your bug has not already been filed.
Include your code
To fix any bug we must first reproduce it. To make this possible, please attach a small, runnable project or post a small, runnable code listing that reproduces what you are seeing.
It is often impossible for us to reproduce a bug when working with only code snippets since we have to guess at the missing code.
Use triple-tick code fences for any posted code.
dotnet ef dbcontext scaffold "ConnectionString" MySql.Data.EntityFrameworkCore -o Model -f
Include stack traces
Include the full exception message and stack trace for any exception you encounter.
Use triple-tick fences for stack traces.
Failed to load /usr/local/share/dotnet/host/fxr/6.0.0-preview.3.21201.4/libhostfxr.dylib, error: dlopen(/usr/local/share/dotnet/host/fxr/6.0.0-preview.3.21201.4/libhostfxr.dylib, 1): no suitable image found. Did find:
/usr/local/share/dotnet/host/fxr/6.0.0-preview.3.21201.4/libhostfxr.dylib: mach-o, but wrong architecture
/usr/local/share/dotnet/host/fxr/6.0.0-preview.3.21201.4/libhostfxr.dylib: mach-o, but wrong architecture
The library libhostfxr.dylib was found, but loading it from /usr/local/share/dotnet/host/fxr/6.0.0-preview.3.21201.4/libhostfxr.dylib failed
- Installing .NET prerequisites might help resolve this problem.
https://go.microsoft.com/fwlink/?linkid=2063366
Include verbose output
Please include --verbose
output when filing bugs about the dotnet ef
or Package Manager Console tools.
Use triple-tick fences for tool output.
Failed to load /usr/local/share/dotnet/host/fxr/6.0.0-preview.3.21201.4/libhostfxr.dylib, error: dlopen(/usr/local/share/dotnet/host/fxr/6.0.0-preview.3.21201.4/libhostfxr.dylib, 1): no suitable image found. Did find:
/usr/local/share/dotnet/host/fxr/6.0.0-preview.3.21201.4/libhostfxr.dylib: mach-o, but wrong architecture
/usr/local/share/dotnet/host/fxr/6.0.0-preview.3.21201.4/libhostfxr.dylib: mach-o, but wrong architecture
The library libhostfxr.dylib was found, but loading it from /usr/local/share/dotnet/host/fxr/6.0.0-preview.3.21201.4/libhostfxr.dylib failed
- Installing .NET prerequisites might help resolve this problem.
https://go.microsoft.com/fwlink/?linkid=2063366
Include provider and version information
EF Core version: 5.0.6 Database provider: MySql.Data.EntityFrameworkCore Target framework: 6.0.100-preview.3.21202.5 Operating system: macOS Big Sur 11.3.1 M1 IDE: console
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 6
- Comments: 30 (12 by maintainers)
☹️ Sorry friends, I’m still trying to get access to an M1 so I can dig into this.
My mistake, it is not completely fixed, dotnet --version, build, run is working, but the ef scaffold is not
The SDK team says this is a known issue. The x64 and arm64 installers stomp over each other and cause problems. Try uninstalling, deleting everything under
/usr/local/share/dotnet
then try again.solved!
Correct me if I’m wrong, but I think the only remaining issue here is just a duplicate of #25927.
@johnseed Can you try with Npgsql.EntityFrameworkCore.PostgreSQL now that preview 6 is released?
I guess it is fixed in preview6, but the debugger not working with Visual Studio for MAC, that’s another issue.
Update: doing some cleanup (removing old versions) and reinstalling did make it work
Don’t really get what happened there.