I'm working on ASP.NET Project with .NET 5.0. For Database creation, I've run the command
dotnet tool install --global dotnet-ef
After the installing, when I run this command:
dotnet ef
I got that error
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/afshalathar/.dotnet/tools/.store/dotnet-ef/6.0.0/dotnet-ef/6.0.0/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:
I'm using Mac M1
Late to the party, but I had the same issue on a M1 Macbook. Strangely enough, the following steps worked for me:
sudo dotnet tool uninstall dotnet-ef --globaldotnet tool update --global dotnet-ef