-
Notifications
You must be signed in to change notification settings - Fork 734
Enable PrunePackageReference for .NET Core and .NET Standard 2.0 and above #6239
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jeffkl
previously approved these changes
Jan 25, 2025
zivkan
reviewed
Jan 26, 2025
jeffkl
approved these changes
Jan 27, 2025
jgonz120
approved these changes
Jan 27, 2025
Member
Author
|
I'll merge this optimistically since we might need to do an insertion. |
jonathanpeppers
added a commit
to dotnet/java-interop
that referenced
this pull request
Feb 11, 2025
Context: NuGet/NuGet.Client#6239 .NET 10 Preview 1 enables `$(RestoreEnablePackagePruning)=true` by default. This produces multiple warnings as errors in dotnet/android: external\Java.Interop\tests\Java.Interop.Dynamic-Tests\Java.Interop.Dynamic-Tests.csproj : error NU1510: Warning As Error: PackageReference Microsoft.CSharp will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary. The `Microsoft.CSharp` package does seem like it can just be removed.
jonathanpeppers
added a commit
to dotnet/android
that referenced
this pull request
Feb 11, 2025
Context: NuGet/NuGet.Client#6239 .NET 10 Preview 1 enables `$(RestoreEnablePackagePruning)=true` by default. This produces multiple warnings as errors in dotnet/android: src\Xamarin.Android.Build.Tasks\Tests\Xamarin.ProjectTools\Xamarin.ProjectTools.csproj : warning NU1510: PackageReference System.Formats.Asn1 will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary. src\Xamarin.Android.Build.Tasks\Tests\Xamarin.ProjectTools\Xamarin.ProjectTools.csproj : warning NU1510: PackageReference Microsoft.Win32.Registry will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary. src\Xamarin.Android.Build.Tasks\Tests\Xamarin.Android.Build.Tests\Xamarin.Android.Build.Tests.csproj : warning NU1510: PackageReference System.Formats.Asn1 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. 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. tests\MSBuildDeviceIntegration\MSBuildDeviceIntegration.csproj : warning NU1510: PackageReference System.Formats.Asn1 will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary.
jonathanpeppers
added a commit
to mono/debugger-libs
that referenced
this pull request
Feb 11, 2025
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. It appears we can safely remove these references for `net6.0` `$(TargetFramework)`.
jonathanpeppers
added a commit
to mono/debugger-libs
that referenced
this pull request
Feb 11, 2025
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)`.
jonathanpeppers
added a commit
to dotnet/java-interop
that referenced
this pull request
Feb 11, 2025
Context: NuGet/NuGet.Client#6239 .NET 10 Preview 1 enables `$(RestoreEnablePackagePruning)=true` by default. This produces multiple warnings as errors in dotnet/android: external\Java.Interop\tests\Java.Interop.Dynamic-Tests\Java.Interop.Dynamic-Tests.csproj : error NU1510: Warning As Error: PackageReference Microsoft.CSharp will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary. The `Microsoft.CSharp` package does seem like it can just be removed.
thaystg
pushed a commit
to mono/debugger-libs
that referenced
this pull request
Feb 11, 2025
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)`.
jonathanpeppers
added a commit
to dotnet/android
that referenced
this pull request
Feb 18, 2025
Changes: dotnet/sdk@c0f88f2...2f1799b Changes: dotnet/runtime@7324dd1...751acde Updates: * Microsoft.NET.Sdk: from 10.0.100-preview.2.25108.4 to 10.0.100-preview.2.25114.7 * Microsoft.NETCore.App.Ref: from 10.0.0-preview.2.25107.7 to 10.0.0-preview.2.25112.7 * Microsoft.NET.ILLink.Tasks: from 10.0.0-preview.2.25107.7 to 10.0.0-preview.2.25112.7 Other changes: Context: NuGet/NuGet.Client#6239 dotnet/sdk/main enables `$(RestoreEnablePackagePruning)=true` by default. This produces a warning in the `DotNetBuild()` MSBuild test, such as: warning NU1510: PackageReference System.Text.Json will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary. Remove the package from the test to solve the warning. Co-authored-by: Jonathan Peppers <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bug
Fixes: https://github.com/NuGet/Client.Engineering/issues/3110
Description
Enable package pruning for .NET 10 preview 1.
Note that while we double insert into .NET 9 and .NET 10, the SDKAnalysisLevel check ensures we only enable it for .NET 10.
PR Checklist