Skip to content

Packages pruned by NuGet Package Pruning disappear from the SBOM #1108

Description

@Whathecode

This tool relies on project.assets.json to list all dependencies in the SBOM. But, this file is affected by package pruning from .NET 10 onwards:

... package pruning removes packages from the restore graph when the .NET Runtime Libraries already provide them.

For example, if you take on a direct dependency to System.ServiceModel.Primitives, this includes a transitive dependency to Microsoft.Extensions.ObjectPool and System.Security.Cryptography.Xml. But, project.assets.json will only list Microsoft.Extensions.ObjectPool as System.Security.Cryptography.Xml is pruned.

Using --recursive at least causes the dependency to be linked (since it is retrieved through PackageReference instead). However, it still does not link the dependency to where it was pulled in from.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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