Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React to NuGet package pruning warnings #112357

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Conversation

ViktorHofer
Copy link
Member

Contributes to dotnet/sdk#46642

NuGet added a new feature that automatically prunes package and project references that are provided by the shared framework that is targeted.

Resolve the few warnings that got emitted in ref projects when source-building the repository.

Also delete the target in packaging.targets as NuGet now handles this for us instead.

Contributes to dotnet/sdk#46642

NuGet added a new feature that automatically prunes package and project references that are provided by the shared framework that is targeted.

Resolve the few warnings that got emitted in ref projects when source-building the repository.
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-infrastructure-libraries
See info in area-owners.md if you want to be subscribed.

</ItemGroup>
</Target>

<Target Name="WarnOnProjectReferenceToFrameworkAssemblies"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you double check that NuGet is getting the right data for pruning when we use our live-built framework?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I just added a commit that generates the PackageOverrides.txt file as part of the libs.sfx subset.

@filipnavara
Copy link
Member

There could be few more in different build subsets:

/home/ubuntu/runtime/src/installer/tests/TestUtils/TestUtils.csproj : error NU1511: Warning As Error: A ProjectReference cannot be pruned, System.Text.Json. [/home/ubuntu/runtime/Build.proj]
/home/ubuntu/runtime/src/installer/tests/Microsoft.DotNet.CoreSetup.Packaging.Tests/Microsoft.DotNet.CoreSetup.Packaging.Tests.csproj : error NU1510: Warning As Error: PackageReference System.Formats.Asn1 will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary. [/home/ubuntu/runtime/Build.proj]
/home/ubuntu/runtime/src/installer/tests/Microsoft.DotNet.CoreSetup.Packaging.Tests/Microsoft.DotNet.CoreSetup.Packaging.Tests.csproj : error NU1511: Warning As Error: A ProjectReference cannot be pruned, System.Text.Json. [/home/ubuntu/runtime/Build.proj]

@ViktorHofer
Copy link
Member Author

ViktorHofer commented Feb 12, 2025

There are definitely more. This is for the number of projects that get source-built. I will submit another set of PRs to repos when we update Arcade or the VMR to an SDK that has package pruning enabled.

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

Successfully merging this pull request may close these issues.

3 participants