The library 'libhostpolicy.dylib' required to execute the application was not found in

.NET Core应用程序需要runtimeconfig.json文件。此JSON文件配置运行时的选项。没有runtimeconfig.json文件,这将失败。

> dotnet Program.dll
A fatal error was encountered. The library 'libhostpolicy.dylib' required to execute the application was not found in '/Users/nmcmaster/code/'.

这意味着.NET Core无法找到用于执行Program.dll文件的一些必需的.NET Core 要解决此问题,请创建一个以Program.runtimeconfig.json这些内容命名的文件 

如果安装了更高版本的Microsoft.NETCore.App,例如shared/Microsoft.NETCore.App/2.0.4/,dotnet将自动选择更高版本。

{
  "runtimeOptions": { "framework": { "name": "Microsoft.NETCore.App", "version": "2.0.0" } } }

你可能感兴趣的:(The library 'libhostpolicy.dylib' required to execute the application was not found in)