NET 10 Package Pruning Warning NU1510 Can Break CI Builds on SDK Upgrade
Starting with .NET 10, NuGet's package pruning feature is enabled by default for projects targeting .NET 10 or later, raising a NU1510 warning when a direct package reference is redundant because the SDK already supplies the same assembly. In repositories that treat warnings as errors, this causes restore to fail with a non-zero exit code, effectively breaking CI pipelines after an SDK upgrade. For single-target net10.0 applications, the fix is straightforward — removing the redundant PackageReference entirely — since the framework itself provides the assembly. However, multi-target libraries that still support older targets like netstandard2.0 must conditionally retain the reference for those frameworks to avoid breaking the dependency contract for package consumers. Microsoft recommends evaluating each target individually rather than deleting the reference globally, and verifying the packaged output to ensure downstream consumers receive correct dependency metadata.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in