question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dotnet-ef requires x64 SDK on macOS Monterey with Apple Silicon (M1)

See original GitHub issue

When 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

  1. Install the Arm64 version of the .NET 6.0 SDK dotnet-sdk-6.0.100-preview.7.21379.14-osx-arm64.pkg
  2. 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
  3. Execute the command dotnet ef
  4. 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:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
spahnkecommented, Sep 15, 2021

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.

2reactions
spahnkecommented, Oct 13, 2021

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.

codesign -s - ~/.dotnet/tools/dotnet-ef
Read more comments on GitHub >

github_iconTop Results From Across the Web

Install .NET on macOS
In this article, you'll learn how to install .NET on macOS. .NET is made up of the runtime and the SDK. The runtime...
Read more >
Visual Studio for Mac 8.10 and .NET on Apple Silicon ...
On Apple Silicon machines (also known as M1, M2, or ARM), Visual Studio for ... .NET 6 x64 SDK is required for building...
Read more >
dotnet: command not found in Mac
So I downloaded NET Core 2.1 SDK for mac and installed it. But when I run the dotnet command from terminal it throws...
Read more >
How to run .NET on a Mac (command line) Apple silicon M1 ...
How to install .NET on Mac and run an app. 00:00 Introduction 00:09 Downloading .NET for Mac 00:57 Running installer 01:32 Checking install ......
Read more >
Installing .NET 6 on your M1 Mac (manually) - Maarten Merken
In this short article, I'll show you how to uninstall any previous dotnet versions on your M1 Mac and install the latest .NET...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found