{
  "id": 3126684,
  "title": ".NET 10 NU1510 Package Pruning: Fix CI Without Breaking Legacy Targets",
  "url": "https://urgent.news/2026/08/24/net-10-nu1510-package-pruning-fix-ci-without-breaking-legacy-targets",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-08-24T22:23:40.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/ssukhpinder/net-10-nu1510-package-pruning-fix-ci-without-breaking-legacy-targets-5ggd"
  },
  "original_language": "en",
  "account": ".NET 10 introduced package pruning for projects targeting .NET 10 or later, which automatically removes direct references to packages already supplied by the targeted SDK. When a repository promotes warnings to errors through the TreatWarningsAsErrors property, deleting these references can cause CI failures, especially for libraries targeting older frameworks like netstandard2.0. The recommended solution is to conditionally include the package reference based on the target framework, retaining it for netstandard2.0 where necessary and removing it for net10.0 only applications. This approach ensures the library's functionality remains intact while avoiding CI failures caused by the NU1510 diagnostic. It is important to verify the dependency graph for all supported targets before removing any references, as suppressing the warning alone does not guarantee the correct published dependency contract.",
  "summary": ".NET 10 NU1510 package pruning can turn an SDK upgrade into a failed restore when a repository promotes warnings to errors. The tempting fix is to delete the named PackageReference everywhere. That is safe for a net10.0 -only application when the framework supplies the assembly, but it can break a library that still targets netstandard2.0 . I treat NU1510 as a target-specific dependency decision:…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}