发生了致命错误.找不到所需的库 hostfxr.dll [英] A fatal error occurred. The required library hostfxr.dll could not be found

查看:874
本文介绍了发生了致命错误.找不到所需的库 hostfxr.dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在其他计算机上运行我的 WPF 应用程序时,它会引发此错误:

When I run my WPF application on other computers it throws me this error:

Description: A .NET Core application failed.
Application: program.exe
Path: C:fakepathprogram.exe
Message: A fatal error occurred. The required library hostfxr.dll could not be found.
If this is a self-contained application, that library should exist in 
[C:fakepath].
If this is a framework-dependent application, install the runtime in the global location [C:Program 
Filesdotnet] or use the DOTNET_ROOT environment variable to specify the runtime location or 
register the runtime location in [HKLMSOFTWAREdotnetSetupInstalledVersionsx64InstallLocation].

添加库运行时 3.1.0 对我有帮助.

Add library runtime 3.1.0 it help me.

推荐答案

进一步 Ajith 的回答,部署模式:自包含"也可以在 Visual Studio 2019 中选择:

Further to Ajith's answer, "Deployment Mode: Self Contained" can also be selected in Visual Studio 2019 here:

这篇关于发生了致命错误.找不到所需的库 hostfxr.dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆