PrivateAssets="all" metadata in Packaging.props is problematic
- Dominant language
- C#
- Stars
- 7.7k
- Forks
- 1.3k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 61
Description
https://github.com/dotnet/wpf/blob/5a350c206efddc083df149960e4a34233aff9b9a/eng/WpfArcadeSdk/tools/Packaging.props#L67
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.
Contributor guide
Assessment
This issue has not been assessed yet.