NuGet "error NU1101: Unable to find package" in CI
NuGet queried every configured feed and none of them publishes a package with that id. NU1101 is about the id itself: a typo, a private package whose feed is not configured, or a feed that returned nothing.
What this error means
dotnet restore stops with "error NU1101: Unable to find package X. No packages exist with this id in source(s): nuget.org". The build never reaches compilation.
error NU1101: Unable to find package Contoso.Internal.Utils. No packages exist with this id in source(s): nuget.orgCommon causes
A misspelled or wrong package id
The id in the PackageReference does not match any published package, so every feed returns nothing for it.
A private feed is not configured in CI
The package lives on an internal feed that the runner has no nuget.config source for, so only nuget.org is searched and the id is absent.
How to fix it
Confirm the id and the source list
- Check the exact
Includevalue on thePackageReferenceagainst the feed. - Confirm the feed that hosts the package is listed in
nuget.config. - Re-run
dotnet restoreand verify the source(s) line now includes that feed.
<PackageReference Include="Contoso.Internal.Utils" Version="1.4.0" />Add the private feed as a source
Register the internal feed in a committed nuget.config so restore searches it.
<configuration>
<packageSources>
<add key="contoso" value="https://pkgs.contoso.com/v3/index.json" />
</packageSources>
</configuration>How to prevent it
- Commit a
nuget.configthat lists every feed your packages need. - Verify package ids against the feed, not the namespace you import.
- Restore locally with the same
nuget.configCI uses.