Skip to content
Latchkey

dotnet restore "lists package X but multiple packages" in CI

The feed reported one package id in its index but then returned multiple entries that differ only by case or duplication. NuGet cannot pick a single canonical package, so restore fails on that source.

What this error means

restore fails with a message that the feed "lists package X" but multiple packages exist, typically when a private feed has both MyPackage and mypackage published.

dotnet
error : The feed 'private [https://.../index.json]' lists package 'Contoso.Utils'
      but multiple packages with different cases were found. Package ids must be unique per feed.

Common causes

The feed has case-colliding package ids

Two uploads with ids differing only in case (Contoso.Utils and contoso.utils) coexist, and NuGet refuses to treat them as one package.

A duplicate registration on the feed

A feed re-index or a partial mirror left two registration entries for the same id, so the index is ambiguous.

How to fix it

Deduplicate the package on the feed

  1. Identify the colliding ids on the feed (differ only by case or duplication).
  2. Unlist or delete the incorrect variant so one canonical id remains.
  3. Re-run restore once the feed exposes a single entry.

Reference the canonical id consistently

Use one exact casing for the PackageReference id across the solution so restore does not straddle both variants.

.csproj
<PackageReference Include="Contoso.Utils" Version="1.4.0" />

How to prevent it

  • Publish each package id with one consistent casing.
  • Enforce id uniqueness on the private feed.
  • Reference package ids with a single canonical casing across projects.

Related guides

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