Skip to main content

Nuget packages: Shared library in NET9.0 SdkProject

A nuget project doesn't include a references shared library.

(opening the Your.Client.1.0.1.nupkg should have the library in the "lib" folder)

 

You can force it by modifying the cs.proj

 


  <ItemGroup>
    <ProjectReference Include="..\Your.Lib.Shared\Your.Lib.Shared.csproj" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="..\Your.Lib.Shared\bin\Release\net9.0\Your.Lib.Shared.dll">
      <Pack>true</Pack>
      <PackagePath>lib/net9.0/</PackagePath>
    </Content>
    <Content Include="..\Your.Lib.Shared\bin\Release\net9.0\Your.Lib.Shared.pdb">
      <Pack>true</Pack>
      <PackagePath>lib/net9.0/</PackagePath>
    </Content>
  </ItemGroup>