Skip to content

Allow opting out of transitive private assets package reference packing #37

@kzu

Description

@kzu

Currently, you can pack an entire graph of transitive dependencies along with your package by simply adding PrivateAssets=all on the PackageReference:

  <ItemGroup>
    <PackageReference Include="NuGetizer" Version="0.5.0" />
    <PackageReference Include="Scriban" Version="3.0.4" PrivateAssets="all" />
  </ItemGroup>

There is currently no way of stopping the transitivity, however. You'd have to manually add each dependency and set Pack=false on it to stop this behavior.

We should support a new PackTransitive=false attribute to opt-out of this behavior. I'd still keep the transitive packing on by default since that's the most common approach when doing private assets for a dependency (in my experience, i.e. tools or msbuild tasks).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions