PS C:\Users\Anjali kumari> dotnet-ef => A fatal error occurred. The required library hostfxr.dll could not be found

Rohan Kumar Verma 1 Reputation point
2022-01-22T11:38:18.883+00:00

PS C:\Users\Anjali kumari> dotnet --info
.NET SDK (reflecting any global.json):
Version: 6.0.100
Commit: 9e8b04bbff

Runtime Environment:
OS Name: Windows
OS Version: 10.0.19043
OS Platform: Windows
RID: win10-x64
Base Path: C:\Users\Anjali kumari\AppData\Roaming.dotnet\sdk\6.0.100\

Host (useful for support):
Version: 6.0.0
Commit: 4822e3c3aa

.NET SDKs installed:
6.0.100 [C:\Users\Anjali kumari\AppData\Roaming.dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.0 [C:\Users\Anjali kumari\AppData\Roaming.dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.0 [C:\Users\Anjali kumari\AppData\Roaming.dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.0 [C:\Users\Anjali kumari\AppData\Roaming.dotnet\shared\Microsoft.WindowsDesktop.App]

PS C:\Users\Anjali kumari> dotnet tool list --global

Package Id Version Commands

dotnet-aspnet-codegenerator 6.0.1 dotnet-aspnet-codegenerator
dotnet-ef 6.0.1 dotnet-ef

PS C:\Users\Anjali kumari> dotnet-ef
A fatal error occurred. The required library hostfxr.dll could not be found.
If this is a self-contained application, that library should exist in [C:\Users\Anjali kumari.dotnet\tools.store\dotnet-ef\6.0.1\dotnet-ef\6.0.1\tools\netcoreapp3.1\any].
If this is a framework-dependent application, install the runtime in the global location [C:\Program Files\dotnet] or use the DOTNET_ROOT environment variable to specify the runtime location or register the runtime location in [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x64\InstallLocation].

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
764 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,180 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.