Skip to content
Latchkey

NuGet "error NU1102: Unable to find package with version" in CI

Unlike NU1101, the package id was found, but no published version matches the requested range. NU1102 lists the nearest versions the feed actually has so you can see the gap.

What this error means

dotnet restore fails with "error NU1102: Unable to find package X with version (>= 9.9.9). Found N version(s) in nuget.org [Nearest version: ...]".

dotnet
error NU1102: Unable to find package Newtonsoft.Json with version (>= 99.0.0)
  - Found 100 version(s) in nuget.org [ Nearest version: 13.0.3 ]

Common causes

A version pin that does not exist

The Version in the PackageReference is higher (or lower) than anything published, so no candidate satisfies the constraint.

A private prerelease only on another feed

The version exists as a prerelease or on an internal feed that the restore source list does not include.

How to fix it

Pin to a version the feed lists

  1. Read the "Nearest version" hint NU1102 prints.
  2. Set the PackageReference to a version that is actually published.
  3. Re-run dotnet restore to confirm it resolves.
Project.csproj
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />

Allow prereleases when the target is a preview

If you truly need a preview build, request it explicitly and ensure its feed is configured.

Project.csproj
<PackageReference Include="Contoso.Lib" Version="2.0.0-preview.3" />

How to prevent it

  • Pin only to versions you have confirmed are published.
  • Use a committed lockfile so versions are validated before CI.
  • Configure prerelease feeds explicitly rather than guessing versions.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →