C#C
C#4y ago
swagrid

.runtimeconfig.json in PackageReference not copied to OutDir

I have a nuget package that contains a managed dll and a corresponding runtimeconfig.json (both in /lib/net6.0). That nuget package is referenced in a C# project. When I build the project only the dll is copied to OutDir, the runtimeconfig.json is missing.

What I have to do now is
  <ItemGroup>
    <PackageReference Include="Bla" Version="1.2.3" GeneratePathProperty="true" />
  </ItemGroup>

  <ItemGroup>
    <None Include="$(PkgBla)/lib/net6.0/Bla.runtimeconfig.json" CopyToOutputDirectory="Always" Visible="false" />
  </ItemGroup>


Is there a better solution to this?
Was this page helpful?