一個可控制臺程序使用.NET 6開發(fā),發(fā)行版運行出現(xiàn)如下錯誤:
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 [D:\xxxServer\].
If this is a framework-dependent application, install the runtime in the global location [C:\Program Files (x86)\dotnet] or use the DOTNET_ROOT environment variable to specify the runtime location or register the runtime location in [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation].
The .NET runtime can be found at:
- https://aka.ms/dotnet-core-applaunch?missing_runtime=true&arch=x86&rid=win81-x86&apphost_version=6.0.5
根據(jù)提示提供的鏈接直接下載是不行的,因為這個鏈接默認(rèn)會轉(zhuǎn)到ASP.NET Core 6.0 Runtime下載頁面,而我的程序是桌面程序,需要安裝 .NET 桌面運行時:https://dotnet.microsoft.com/zh-cn/download/dotnet/6.0文章來源:http://www.zghlxwxcb.cn/news/detail-526310.html
下載安裝后就不會有找不到hostfxr.dll的提示了。文章來源地址http://www.zghlxwxcb.cn/news/detail-526310.html
到了這里,關(guān)于A fatal error occurred. The required library hostfxr.dll could not be found.錯誤處理的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!