Skip to content
Latchkey

NuGet "error NU1605: Detected package downgrade" in CI

A transitive dependency in your graph requires a higher version of a package than a direct reference (or another path) pins. NuGet treats a forced downgrade as an error and names both ends of the conflict.

What this error means

dotnet restore fails with "error NU1605: Detected package downgrade: X from 8.0.0 to 6.0.0" and shows the two dependency paths that disagree.

dotnet
error NU1605: Detected package downgrade: System.Text.Json from 8.0.0 to 6.0.0.
 MyApp -> Some.Lib 4.0.0 -> System.Text.Json (>= 8.0.0)
 MyApp -> System.Text.Json (>= 6.0.0)

Common causes

A direct reference pins a lower version than a transitive one needs

Your project references the package at 6.0.0 directly, but a dependency requires 8.0.0; resolving to 6.0.0 would be a downgrade.

A stale pin after upgrading another dependency

You bumped a library whose transitive requirement rose, but left an old direct pin behind.

How to fix it

Raise the direct reference to the required version

  1. Read the two paths NU1605 prints and note the higher required version.
  2. Update the direct PackageReference to at least that version.
  3. Re-run dotnet restore to confirm the downgrade is gone.
Project.csproj
<PackageReference Include="System.Text.Json" Version="8.0.0" />

Use central package management to pin once

Set the version in one Directory.Packages.props so every project agrees and no path forces a downgrade.

Directory.Packages.props
<ItemGroup>
  <PackageVersion Include="System.Text.Json" Version="8.0.0" />
</ItemGroup>

How to prevent it

  • Pin shared packages at or above the highest transitive requirement.
  • Adopt central package management so versions stay consistent.
  • Re-restore after every dependency bump to catch downgrades early.

Frequently asked questions

What causes ""error NU1605: Detected package downgrade""?
Your project references the package at 6.0.0 directly, but a dependency requires 8.0.0; resolving to 6.0.0 would be a downgrade.
How do I fix "error 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