.NET Core 在Windows系统安装后出现Failed to load the hostfxr.dll等问题的解决方法

这次无论如何也要记录下,原因是今天在一台Windows2008R2的电脑上安装.NET Core SDK后再命令行执行dotnet --info 居然爆出了“Failed to load the hostfxr.dll”的问题,之前也遇到过,但是解决了,却没有做记录,害的这里又google了一把!所以写篇文章记录下。额外说一句,部分500.25问题也是这个原因导致的!.

作者:依乐祝
原文地址:https://www.cnblogs.com/yilezhu/p/10057789.html

具体的错误信息如下:

Failed to load the dll from [C:\Program
Files\dotnet\host\fxr\版本号\hostfxr.dll], HRESULT: 0x80070057
The library hostfxr.dll was found, but loading it from C:\Program
Files\dotnet\host\fxr\版本号\hostfxr.dll failed

  • Installing .NET Core prerequisites might help resolve this problem.
    http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409

解决方法是需要安装KB2533623 这个补丁。这里需要注意下,不同系统版本需要对应具体的补丁,有32位与64位之分。具体的信息你可以访问这个页面进行查看,https://support.microsoft.com/en-us/help/2533623/microsoft-security-advisory-insecure-library-loading-could-allow-remot

.NET Core 在Windows系统安装后出现Failed to load the hostfxr.dll等问题的解决方法

文中提供了windows7以及Windows Server 2008 R2对应的更新,大伙下载安装一下。然后再执行dotnet --info 命令,就可以看到久违的界面:

.NET Core 在Windows系统安装后出现Failed to load the hostfxr.dll等问题的解决方法

貌似只有Windows7 以及Windows Server 2008 R2才会出现这个问题。

当然还有其他的情况导致.net core sdk 运行异常的!有时候还需要安装 KB2999226这个更新,等下次遇到再补上吧!因为上次出现需要安装KB2999226这个更新的时候我没有做记录啊!