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

Fix NU1510 warning as error #415

Merged
merged 1 commit into from
Feb 11, 2025
Merged

Fix NU1510 warning as error #415

merged 1 commit into from
Feb 11, 2025

Conversation

jonathanpeppers
Copy link
Member

Context: NuGet/NuGet.Client#6239

.NET 10 Preview 1 enables $(RestoreEnablePackagePruning)=true by default.

This produces multiple warnings (as errors) in dotnet/android:

external/debugger-libs/Mono.Debugger.Soft/Mono.Debugger.Soft.csproj : warning NU1510: PackageReference System.Runtime will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary.
external/debugger-libs/Mono.Debugger.Soft/Mono.Debugger.Soft.csproj : warning NU1510: PackageReference System.Reflection.Metadata will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary.
external/debugger-libs/Mono.Debugging/Mono.Debugging.csproj : warning NU1510: PackageReference System.Buffers will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary.
external/debugger-libs/Mono.Debugging/Mono.Debugging.csproj : warning NU1510: PackageReference System.Collections.Immutable will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary.

It appears we can safely remove these references for net6.0 $(TargetFramework), and only have them for net472.

I tested these changes here:

Context: NuGet/NuGet.Client#6239

.NET 10 Preview 1 enables `$(RestoreEnablePackagePruning)=true` by default.

This produces multiple warnings (as errors) in dotnet/android:

    external/debugger-libs/Mono.Debugger.Soft/Mono.Debugger.Soft.csproj : warning NU1510: PackageReference System.Runtime will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary.
    external/debugger-libs/Mono.Debugger.Soft/Mono.Debugger.Soft.csproj : warning NU1510: PackageReference System.Reflection.Metadata will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary.
    external/debugger-libs/Mono.Debugging/Mono.Debugging.csproj : warning NU1510: PackageReference System.Buffers will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary.
    external/debugger-libs/Mono.Debugging/Mono.Debugging.csproj : warning NU1510: PackageReference System.Collections.Immutable will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary.

It appears we can safely remove these references for `net6.0`
`$(TargetFramework)`.
@thaystg thaystg merged commit c035307 into main Feb 11, 2025
1 check passed
@jonathanpeppers jonathanpeppers deleted the RestoreEnablePackagePruning branch February 11, 2025 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants