Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

M1 macOS monterey: dotnet-ef fails with libhostfxr.dylib could not be found #26663

Closed
sshquack opened this issue Nov 13, 2021 · 1 comment
Closed
Labels
closed-no-further-action The issue is closed and no further action is planned. customer-reported

Comments

@sshquack
Copy link

sshquack commented Nov 13, 2021

File a bug

I moved from an Intel to an M1 Apple silicon recently. In the new machine dotnet-ef fails to run with error as shown below.

  1. I installed Visual studio for mac x64 https://visualstudio.microsoft.com/vs/mac/ visualstudioformacinstaller-8.10.13.2.dmg
❯ dotnet --info
.NET SDK (reflecting any global.json):
 Version:   5.0.402
 Commit:    e9d3381880

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  12.0
 OS Platform: Darwin
 RID:         osx-x64
 Base Path:   /usr/local/share/dotnet/sdk/5.0.402/

Host (useful for support):
  Version: 5.0.11
  Commit:  f431858f8b

.NET SDKs installed:
  3.1.414 [/usr/local/share/dotnet/sdk]
  5.0.402 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 3.1.20 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.11 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.20 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.11 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  1. I installed the 5.x of dotnet-ef tool
❯ dotnet tool install --global dotnet-ef --version 5.0.12
You can invoke the tool using the following command: dotnet-ef
Tool 'dotnet-ef' (version '5.0.12') was successfully installed.


❯ dotnet tool list --global
Package Id      Version      Commands
--------------------------------------
dotnet-ef       5.0.12       dotnet-ef
  1. Here is the error when invoking
❯ dotnet ef
A fatal error occurred. The required library libhostfxr.dylib could not be found.
If this is a self-contained application, that library should exist in [/Users/ayemacair/.dotnet/tools/.store/dotnet-ef/5.0.12/dotnet-ef/5.0.12/tools/netcoreapp3.1/any/].
If this is a framework-dependent application, install the runtime in the global location [/usr/local/share/dotnet/x64] or use the DOTNET_ROOT environment variable to specify the runtime location or register the runtime location in [/etc/dotnet/install_location].

The .NET runtime can be found at:
  - https://aka.ms/dotnet-core-applaunch?missing_runtime=true&arch=x64&rid=osx.11.1-x64&apphost_version=5.0.11


❯ ll /usr/local/share/dotnet/
total 336
drwxr-xr-x  10 root  wheel     320 12 Nov 19:41 ./
drwxr-xr-x   3 root  wheel      96 12 Nov 19:41 ../
-rw-r--r--   1 root  wheel    1116 21 Sep 13:24 LICENSE.txt
-rw-r--r--   1 root  wheel   31330 21 Sep 13:24 ThirdPartyNotices.txt
-rwxr-xr-x   1 root  wheel  131424 23 Sep 12:27 dotnet*
drwxr-xr-x   3 root  wheel      96 23 Sep 10:59 host/
drwxr-xr-x   6 root  wheel     192 12 Nov 19:41 packs/
drwxr-xr-x   4 root  wheel     128 12 Nov 19:41 sdk/
drwxr-xr-x   4 root  wheel     128 12 Nov 19:41 shared/
drwxr-xr-x   4 root  wheel     128 12 Nov 19:41 templates/
  1. I also tried completely uninstalling everything and starting from the scratch using sudo ./dotnet-uninstall-pkgs.sh (script here) but I keep running into the same issue.

How do I get dotnet-ef to work on M1?

@sshquack
Copy link
Author

Turns out this is not a efcore issue. The root cause is in the dotnet installer compat with Apple M1 arm64. Follow #27787 for details. Closing this.

@ajcvickers ajcvickers added the closed-no-further-action The issue is closed and no further action is planned. label Nov 16, 2021
@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-no-further-action The issue is closed and no further action is planned. customer-reported
Projects
None yet
Development

No branches or pull requests

2 participants