Failed to load the hostfxr.dll after install net core

11

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
c#
asp.net-core
visual-studio-code
asked on Stack Overflow Jun 1, 2018 by Tom Karnaski

2 Answers

17

Installing this update will solve the problem for Windows 7:

https://www.microsoft.com/en-us/download/details.aspx?id=26767

answered on Stack Overflow Jun 14, 2018 by Braytiner • edited Jun 13, 2019 by Matt
4

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();
}
answered on Stack Overflow Jan 16, 2019 by Mohammed Osman • edited Jun 13, 2019 by Mohammed Osman

User contributions licensed under CC BY-SA 3.0