dotnet-ef requires x64 SDK on macOS Monterey with Apple Silicon (M1)
See original GitHub issueWhen installing the Arm64
version of the latest .NET 6.0 SDK (SDK 6.0.100-preview.7
) on an Apple M1 Mac running the latest beta OS (macOS Monterey), the dotnet ef
tooling fails to run properly and no error is given.
Steps to reproduce
- Install the
Arm64
version of the .NET 6.0 SDK dotnet-sdk-6.0.100-preview.7.21379.14-osx-arm64.pkg - Install the latest .NET 6 preview EF Core tools by running the command
dotnet tool install --global dotnet-ef --version 6.0.0-preview.7.21378.4
- Execute the command
dotnet ef
- The console (zsh) immediately returns and no error is provided
Additional Info
I tried several things to see if I could get an underlying message to display or log. The most telling was when I cd ~/.dotnet/tools/
and ran sudo ./dotnet-ef
. This produced the following output:
zsh: killed dotnet-ef
which when googled led me to the following closed issue https://github.com/dotnet/runtime/issues/48387
Current workarounds
1. Installing x64 version of SDK for global access to dotnet ef
After trying several things, I decided to uninstall the Arm64
SDK and install the x64
SDK (dotnet-sdk-6.0.100-preview.7.21379.14-osx-x64.pkg) and was able to successfully run dotnet ef
.
2. Installing dotnet ef
locally
As pointed out by @spahnke below https://github.com/dotnet/efcore/issues/25927#issuecomment-919802499, you can install dotnet-ef
locally with the arm64
version of the SDK installed. Simply go to the root of you project/solution and execute the following two commands:
dotnet new tool-manifest
dotnet tool install dotnet-ef --version 6.0.0-rc.1.21452.10
Environment info
Below is the result of a call to dotnet --info
.NET SDK (reflecting any global.json):
Version: 6.0.100-preview.7.21379.14
Commit: 22d70b47bc
Runtime Environment:
OS Name: Mac OS X
OS Version: 12.0
OS Platform: Darwin
RID: osx-x64
Base Path: /usr/local/share/dotnet/sdk/6.0.100-preview.7.21379.14/
Host (useful for support):
Version: 6.0.0-preview.7.21377.19
Commit: 91ba01788d
.NET SDKs installed:
6.0.100-preview.7.21379.14 [/usr/local/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.0-preview.7.21378.6 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.0-preview.7.21377.19 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download
EF Core version: 6.0.0-preview.7.21378.4 Database provider: n/a Target framework: .NET 6.0 Operating system: macOS Monterey (version 12.0 beta 21A5506j) IDE: n/a
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:12 (5 by maintainers)
I encountered the same issue and for me installing the tool locally in the project folder works even with the arm64 build of the SDK (both preview 7 and RC 1). It’s only the globally installed tool that fails.
Note: I’m currently only playing around with EF Core on my M1 Mac, so I can’t speak for every scenario. But I thought I mention it at least.
I think this is now tracked by https://github.com/dotnet/sdk/issues/21349 which is still open. That issue also shows yet another workaround by signing the global tool yourself.