linux .net core dotnet执行exe缺失libhostpolicy.so
dotnet "zhtz.exe"
A fatal error was encountered. The library 'libhostpolicy.so' required to execute the application was not found in '/opt/cshop/'.
Failed to run as a self-contained app.
- The application was run as a self-contained app because '/opt/cshop/zhtz.runtimeconfig.json' was not found.
- If this should be a framework-dependent app, add the '/opt/cshop/zhtz.runtimeconfig.json' file and specify the appropriate framework.
- 新增配置文件
zhtz.runtimeconfig.json
vim /opt/cshop/zhtz.runtimeconfig.json
{
"runtimeOptions": {
"framework": {
"name": "Microsoft.NETCore.App",
"version": "8.0.0"
},
"additionalProbingPaths": [
"./runtimes/"
]
}
}