I have a project MySdk.csproj that I'm packing at build time via dotnet pack. I want to express that this project has a transitive dependency on Trans.nupkg, but I don't actually want to import all the assets from Trans.nupkg during the build of MySdk.csproj. I DO want a consumer (call it Consumer.csproj) of MySdk.nupkg to get all the assets from Trans.nupkg.
If I ExcludeAssets for Trans.nupkg from MySdk.nupkg then the nuspec and nupkg for MySdk.nupkg reflects the exclusion and when Consumer.csproj references MySdk.nupkg it won't get the transitive assets.
Is there a way to accomplish this?
Thanks.
UPDATE:
If I try to set PrivateAssets to None and ExcludeAssets to build for Trans.nupkg reference from MySdk.csproj like this:
<PackageReference Include="Trans" Version="1.0.*" PrivateAssets="None" ExcludeAssets="build" />
the generated nuspec in MySdk.nupkg looks like this:
<dependency id="Trans" version="1.0.0" include="Runtime,Compile,Native,ContentFiles,Analyzers" />
which means that when Consumer.csproj adds a reference like this:
<PackageReference Include="MySdk" Version="1.0.0" />
the transitive reference back to Trans.nupkg won't include the custom build targets, which is the opposite of what I'm trying to accomplish.