[英]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任何人都有这个问题我改变PC并尝试安装网络核心框架但是当我尝试编写dontet --info时vs代码返回此信息
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
Installing this update will solve the problem for Windows 7 : 安装此更新将解决Windows 7的问题:
https://www.microsoft.com/en-us/download/details.aspx?id=26767 https://www.microsoft.com/en-us/download/details.aspx?id=26767
TL;DR Since the original download is no more, here's what I found on the dell forums: TL;DR 由于原始下载已不复存在,以下是我在戴尔论坛上找到的内容:
Standalone package: Microsoft Update Catalog - KB4457144 独立软件包:Microsoft 更新目录 - KB4457144
I had the exact same error message (apart from the directories) on Win7 with a newer VC++ redist already present.我在Win7 上有完全相同的错误消息(除了目录),并且已经存在较新的 VC++ redist 。
The package contains the KB2533623 that we want.该软件包包含我们想要的 KB2533623。 Details of KB4457144: September 11, 2018—KB4457144 (Monthly Rollup)
KB4457144 的详细信息:2018 年 9 月 11 日—KB4457144(月度汇总)
After installation and a reboot, dotnet new console
goes through without an error.安装并重新启动后,
dotnet new console
将无错误地运行。
Dell forum source: Microsoft Windows 7 Update KB2533623 needed to install Dell Update Package (DUP)戴尔论坛来源: Microsoft Windows 7 Update KB2533623 需要安装戴尔更新包 (DUP)
I faced the same error and I checked my Web API Program.cs
class and found that: .UseIISIntegration()
is missing.我遇到了同样的错误,我检查了我的 Web API
Program.cs
类,发现: .UseIISIntegration()
丢失了。 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();
}
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.
列出我为解决此问题而遵循的步骤。
In my case there was windows7 x64 and according to this instruction: https://docs.microsoft.com/en-us/dotnet/core/install/windows?tabs=net50就我而言,有 windows7 x64 并根据此说明: 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 Windows 7 SP1 ESU - Microsoft Visual C++ 2015-2019 可再发行 64 位/32 位
There was no KB3063858 on my machine.我的机器上没有 KB3063858。 After installation my application has started.
安装后,我的应用程序已启动。
(I uset asp net 5) (我使用asp net 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.
显然,当您第一次发布为 32 位然后发布为 64 位时,会保留一些文件。 When publishing to a clean folder, the error disappeared
发布到干净的文件夹时,错误消失了
This answer fixed my issue;这个答案解决了我的问题; I had built 32 bit first, then tried 64 (which was the correct build).
我先构建了 32 位,然后尝试了 64(这是正确的构建)。 After I deleted the publish folder and re-publishing, the hostfxr.dll problem stopped.
在我删除发布文件夹并重新发布后,hostfxr.dll 问题停止了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.