当我在其他计算机上运行 WPF 应用程序时,它会抛出这个错误:
Description: A .NET Core application failed.
Application: program.exe
Path: C:\fakepath\program.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
Files\dotnet] or use the DOTNET_ROOT environment variable to specify the runtime location or
register the runtime location in [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x64\InstallLocation].
添加库运行时3.1.0对我很有帮助。