Failed to load the hostfxr.dll after install net c

2020-05-23 11:19发布

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

2条回答
唯我独甜
2楼-- · 2020-05-23 11:28

Installing this update will solve the problem for Windows 7:

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

查看更多
3楼-- · 2020-05-23 11:54

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();
}
查看更多
登录 后发表回答