Docker 如何使用dotnet发布为依赖项生成runtimeconfig.json

Docker 如何使用dotnet发布为依赖项生成runtimeconfig.json,docker,.net-core,dll,devops,Docker,.net Core,Dll,Devops,我正在构建一个.NETCore2.1库。它有一个可运行的依赖项,我需要首先启动它 但是,dotnet publish仅为我的库生成.runtimeconfig.json,而不为我的依赖项生成 有没有办法强制dotnet为依赖项生成.runtimeconfig.json 我试过: <PropertyGroup> <GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFile

我正在构建一个.NETCore2.1库。它有一个可运行的依赖项,我需要首先启动它

但是,
dotnet publish
仅为我的库生成
.runtimeconfig.json
,而不为我的依赖项生成

有没有办法强制
dotnet
为依赖项生成
.runtimeconfig.json

我试过:

  <PropertyGroup>
    <GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
    <GenerateDependencyFile>true</GenerateDependencyFile> 
  </PropertyGroup>
如果使用复制解决方案从中删除注释,则映像将成功运行

如果没有解决方法,我会出现以下错误:

A fatal error was encountered. The library 'libhostpolicy.so' required to execute the application was not found in '/app/'.
Failed to run as a self-contained app. If this should be a framework-dependent app, add the /app/IRISGatewayCore21.runtimeconfig.json file specifying the appropriate framework.
A fatal error was encountered. The library 'libhostpolicy.so' required to execute the application was not found in '/app/'.
Failed to run as a self-contained app. If this should be a framework-dependent app, add the /app/IRISGatewayCore21.runtimeconfig.json file specifying the appropriate framework.