Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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
like image 714
Karol Pisarzewski Avatar asked Jun 01 '18 13:06

Karol Pisarzewski


3 Answers

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)

like image 75
Xan-Kun Clark-Davis Avatar answered Nov 10 '22 14:11

Xan-Kun Clark-Davis


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();
}
like image 4
Mohammed Osman Avatar answered Nov 10 '22 14:11

Mohammed Osman


In my case there was windows7 x64 and according to this instruction: https://learn.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)

like image 1
Danil Avatar answered Nov 10 '22 15:11

Danil