[英]Message: A fatal error was encountered. The library 'hostpolicy.dll' required to execute the application was not found in 'C:\Program Files\dotnet'
应用程序不会在 VS 2019 的 Release 文件夹之外运行,在事件查看器中抛出此错误: Message: A fatal error was encountered. The library 'hostpolicy.dll' required to execute the application was not found in 'C:\Program Files\dotnet'.
Message: A fatal error was encountered. The library 'hostpolicy.dll' required to execute the application was not found in 'C:\Program Files\dotnet'.
.exe 如果放在 Release 文件夹中运行良好,但我也需要它在它之外运行,还在 IDE 内多次作为调试运行它,没有任何问题。
有谁知道为什么会这样?
更新:显然将 runtimeconfig.json 移到文件夹外给我同样的错误......我仍然需要可执行文件在任何地方运行,不仅在我的 Release 文件夹中或有我的应用程序的 runtimeconfig.json 文件的地方。
我修好了它。 我所要做的就是右键单击 C# 解决方案并点击“发布”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.