Skip to content

React to NuGet package pruning warnings #112357

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

Merged
merged 9 commits into from
Feb 14, 2025
Merged

React to NuGet package pruning warnings #112357

merged 9 commits into from
Feb 14, 2025

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.

@ViktorHofer ViktorHofer merged commit ffece94 into main Feb 14, 2025
153 of 158 checks passed
@ViktorHofer ViktorHofer deleted the NuGetPruningReaction branch February 14, 2025 16:31
@github-actions github-actions bot locked and limited conversation to collaborators Mar 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants