Skip to content
Latchkey

NuGet "NU1605: Detected package downgrade" in CI

A dependency in the graph asks for a higher version of a package than your direct reference pins, so NuGet would have to downgrade it. NU1605 is an error (not a warning) when WarningsAsErrors or the SDK default treats it as one - the fix is to pin the direct reference up to the required version.

What this error means

Restore fails with NU1605 showing the downgrade chain: a direct (>= lower) against a transitive (>= higher). It reproduces deterministically from the resolved graph.

dotnet
error NU1605: Detected package downgrade: System.Text.Json from 8.0.4 to 8.0.0.
 MyApp -> Some.Library 2.1.0 -> System.Text.Json (>= 8.0.4)
 MyApp -> System.Text.Json (>= 8.0.0)

Common causes

A transitive dependency requires a higher version

A package you depend on pulls in a newer version of a shared package than your own direct reference pins, creating a downgrade across the graph.

An old direct pin was never bumped

A PackageReference was pinned to an older version long ago and never updated as transitive requirements moved forward.

How to fix it

Raise the direct reference to the required version

  1. Read the chain to find the highest version any path requires.
  2. Pin your direct PackageReference at or above that version.
  3. Re-run restore to confirm the downgrade is gone.
.csproj
<PackageReference Include="System.Text.Json" Version="8.0.4" />

Centralize the version under CPM

  1. Move the version into a single PackageVersion in Directory.Packages.props.
  2. Remove inline versions from the projects.
  3. Restore so every project resolves the same, sufficiently-high version.

How to prevent it

  • Bump direct references when transitive requirements move forward.
  • Adopt central package management to avoid per-project drift.
  • Trace the NU1605 chain to find the highest required version before pinning.

Frequently asked questions

What causes ""NU1605: Detected package downgrade""?
A package you depend on pulls in a newer version of a shared package than your own direct reference pins, creating a downgrade across the graph.
How do I fix "NU1605: Detected package downgrade"?
Raise the direct reference to the required version

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card