Skip to content
Latchkey

NuGet "NU1603: depends on X but it was resolved to a different version"

A dependency asked for an exact lower-bound version that does not exist on the feed, so NuGet resolved the nearest higher version and warned with NU1603. It is a warning by default - but fails the build under warnings-as-errors.

What this error means

Restore prints NU1603 saying a requested version "was not found" and an "approximate best match" was used instead. It is benign until a TreatWarningsAsErrors/WarningsAsErrors policy promotes it to a build-breaking error.

dotnet restore output
warning NU1603: MyApp depends on Polly (>= 8.2.1) but Polly 8.2.1 was not found.
An approximate best match of Polly 8.3.0 was resolved.

Common causes

Requested version never published

A dependency (or your own reference) pins a lower-bound version that does not exist on the feed - a typo or a yanked release - so NuGet rounds up to the nearest available.

Warnings promoted to errors

On its own NU1603 is informational. A project or pipeline that treats NuGet warnings as errors turns the approximate-match into a hard failure.

How to fix it

Pin a version that actually exists

Reference a published version so no approximate match is needed.

Terminal
dotnet package search Polly --exact-match
# then pin an existing version
# <PackageReference Include="Polly" Version="8.3.0" />

Scope-suppress the warning if intentional

When the approximate match is acceptable, suppress NU1603 narrowly rather than disabling all NuGet warnings.

.csproj
<PropertyGroup>
  <NoWarn>$(NoWarn);NU1603</NoWarn>
</PropertyGroup>

How to prevent it

  • Pin dependency versions that exist on the feeds CI uses.
  • Verify references with a clean local restore before pushing.
  • Use NoWarn for specific NuGet codes instead of turning warnings-as-errors off entirely.

Frequently asked questions

What causes ""NU1603: ... was resolved to a different version""?
A dependency (or your own reference) pins a lower-bound version that does not exist on the feed - a typo or a yanked release - so NuGet rounds up to the nearest available.
How do I fix "NU1603: ... was resolved to a different version"?
Reference a published version so no approximate match is needed.

Related guides

References

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