Skip to content

PrivateAssets="all" metadata in Packaging.props is problematic #9261

Open
@ViktorHofer

Description

@ViktorHofer

<PrivateAssets>All</PrivateAssets>

This makes all PackageReferences to not flow to consuming projects which can cause issues whenever multiple assemblies with the same identity are referenced and RAR needs to resolve them. One example that we just hit is System.Runtime.Serialization.Formatters.dll which now exists as a package (9.0.0.0) and as the inbox assembly (8.1.0.0).

Example: System.Xaml.csproj references the package (9.0.0.0) but System.Xaml.Tests.csproj doesn't because the package reference in System.Xaml.csproj is private but System.Xaml.Tests.csproj automatically references Formatters from the shared framework (8.1.0.0). Therefore RAR sees that a referenced assembly references the 9.0.0.0 assembly but the project itself only references the 8.1.0.0 and so it can't resolve the correct (the higher) version.

That's why package references are transitive by default and disabling that functionality (via a global PrivateAssets=all metadata) is dangerous.

Metadata

Metadata

Assignees

No one assigned

    Labels

    InvestigateRequires further investigation by the WPF team.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions