Failed to load the hostfxr.dll after install net core
Solution 1
TL;DR Since the original download is no more, here's what I found on the dell forums:
Standalone package: Microsoft Update Catalog - KB4457144
I had the exact same error message (apart from the directories) on Win7 with a newer VC++ redist already present.
The package contains the KB2533623 that we want. Details of KB4457144: September 11, 2018—KB4457144 (Monthly Rollup)
After installation and a reboot, dotnet new console
goes through without an error.
Dell forum source: Microsoft Windows 7 Update KB2533623 needed to install Dell Update Package (DUP)
Solution 2
I faced the same error and I checked my Web API Program.cs
class and found that: .UseIISIntegration()
is missing. I added it and the problem solved.
public class Program
{
public static void Main(string[] args)
{
CreateWebHostBuilder(args).Build().Run();
}
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args).UseStartup<Startup>().UseIISIntegration();
}
Karol Pisarzewski
Updated on May 21, 2021Comments
-
Karol Pisarzewski almost 3 years
Anyone has this problem i change Pc and tried to install net core framework but vs code return this info when i tried to write dontet --info
Failed to load the dll from [C:\Program Files\dotnet\host\fxr\2.1.0\hostfxr.dll], HRESULT: 0x80070057 The library hostfxr.dll was found, but loading it from C:\Program Files\dotnet\host\fxr\2.1.0\hostfxr.dll failed - Installing .NET Core prerequisites might help resolve this problem. http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409
-
Uwe Keim about 5 yearsFor in-process, this should be
.UseIIS()
instead of.UseIISIntegration()
. -
H.A.H. over 3 yearsJust wanna tell you, that if you and others like you did not exist, I would have become MAC user long ago. Saved me my Sunday night...
-
Xan-Kun Clark-Davis over 3 yearsGlad I could help. Took me a good while to hunt this file down and wanted to make sure, I can save someone else the hassle :-)