'Failed to load the hostfxr.dll after install net core
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
Solution 1:[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:[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();
}
Solution 3:[3]
In my case there was windows7 x64 and according to this instruction: https://docs.microsoft.com/en-us/dotnet/core/install/windows?tabs=net50
Windows 7 SP1 ESU - Microsoft Visual C++ 2015-2019 Redistributable 64-bit / 32-bit
- KB3063858 64-bit / 32-bit
- Microsoft Root Certificate Authority 2011 (.NET Core 2.1 offline installer only)
There was no KB3063858 on my machine. After installation my application has started.
(I uset asp net 5)
Solution 4:[4]
Though it is very late but I am trying to list steps to solve this issue hope, this helps! I followed the solutions provided on this link but in my case the deployment environment was the issue. listing down the steps I followed to fix this.
- Deploy .Net core runtime with your application if not available on target machine from https://dotnet.microsoft.com/download/dotnet-core/3.1
- set the environment variable DOTNET_ROOT
- the appropriate deployment path/environment SIT/UAT (in my case) to solve this (a)"Deployment Mode: Self Contained" needs to be selected in Visual studio 2019. while publishing OR (b) dotnet publish -c Release -r --self-contained true
- in case the target machine is 64 bit or 86. C:\Program Files\dotnet OR C:\Program Files (x86)\dotnet you can find the respective folder.
Solution 5:[5]
I had the same problem, but in my case it was because I needed to clear my publish folder first. Apparently when you first publish as 32 bit and then as 64 bit, some files remain. When publishing to a clean folder, the error disappeared
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | |
Solution 2 | |
Solution 3 | Danil |
Solution 4 | Kamlendra Sharma |
Solution 5 | Allie |