NuGet NU1101: unable to find the package in any source
The package is not on any feed this solution queries. Check the inherited source list first, then authentication.

Introduction & Quick Summary
dotnet restore fails with:
error NU1101: Unable to find package Serilog.Sinks.File. No packages exist
with this id in source(s): nuget.orgThe build stops before compilation. NuGet asked every configured source for that package id and none had it. The error is about sources, not about the package itself, which is why the same solution restores on one machine and fails on another.
The four causes, in the order they are actually seen:
- A typo or a renamed package. NuGet ids are exact (
Serilog.Sinks.File, notSerilog.Sink.File); a package that was renamed or deprecated is not found under the old id by default. - A
nuget.configthat cleared the default sources. A repo-level file with<clear />plus one private feed removesnuget.orgentirely, and every public package becomes unfindable. - The package lives only on a private feed you are not authenticated against. The feed answers 401, and with some configurations the failure surfaces as "no packages exist".
- A prerelease-only or unlisted version.
--prereleaseor an explicit version range is required, and the id alone finds nothing.
The first diagnostic is always dotnet nuget list source: it shows what this solution will actually query, including the inheritance chain that most people get wrong.
Core Mechanics, Signatures & Reproducible Setup
NuGet builds a source list from a hierarchy: the machine-level config, the user-level config, then every nuget.config from the drive root down to the current directory, with the closest file winning for most settings and <clear /> able to remove inherited entries. dotnet restore then queries each enabled source's service index and matches package ids case-insensitively against what the source exposes.
dotnet nuget list source # effective list for this directory
dotnet nuget locals all --list # global package folder and http cache
dotnet restore --verbosity detailed # every source query and its resultA minimal reproduction: a project that references a package only a private feed has, restored on a machine with the default config.
<!-- repro.csproj -->
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Acme.Internal.Logging" Version="3.2.1" />
</ItemGroup>
</Project>dotnet restore
# error NU1101: Unable to find package Acme.Internal.Logging.
# No packages exist with this id in source(s): nuget.orgAdd the source properly and the same restore succeeds:
dotnet nuget add source https://nuget.pkg.github.com/acme/index.json \
--name acme --username "$GH_ACTOR" --password "$GH_TOKEN" --store-password-in-clear-text
dotnet restoreKey Comparison Table
| Error code | Meaning | Typical cause | Fix |
|---|---|---|---|
| NU1101 | id not found in any source | typo, missing source, <clear /> | add or fix the source |
| NU1102 | id found, no version in range | version pin too tight | widen the range or the version |
| NU1103 | no version satisfies the minimum | prerelease excluded | include -* or --prerelease |
| NU1301 | unable to load the service index | feed down, 401, proxy | check auth and connectivity |
| NU1109 | downgrade detected | central package management conflict | align versions in one place |
| NU1603 | resolved with a different version | approximate match | add the exact reference |
| Config location | Scope | Wins over |
|---|---|---|
| Machine-level NuGet.Config | all users | nothing below it |
%AppData%/NuGet/NuGet.Config | the user | machine-level |
| Solution directory | that solution | user-level |
| Project directory | that project | solution directory |
Environment RestoreSources | the restore process | most files |
Practical Edge Cases, Error Fixes & Deep Dive Code Examples
1. <clear /> plus one feed is a trap
This is the most common CI failure in enterprise repositories: the config was written for a build server with a mirror, and it silently removes everything public.
<!-- nuget.config -->
<configuration>
<packageSources>
<clear />
<add key="acme" value="https://pkgs.dev.azure.com/acme/_packaging/main/nuget/v3/index.json" />
</packageSources>
</configuration>Add nuget.org explicitly when the project needs public packages, and keep the private feed for internal ones:
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />2. Package source mapping instead of ordering
With more than one feed, NuGet queries all of them for every id, which is slow and, with overlapping private/public mirrors, ambiguous. .NET 6+ supports explicit mapping:
<packageSourceMapping>
<packageSource key="nuget.org">
<package pattern="Serilog.*" />
<package pattern="Microsoft.*" />
</packageSource>
<packageSource key="acme">
<package pattern="Acme.*" />
</packageSource>
</packageSourceMapping>Once mapping exists, a package whose id matches no pattern is reported as unavailable even if a source has it - which is a clear, fast failure instead of a slow one.
3. Authentication that fails quietly
A private feed that answers 401 can surface as NU1301 during restore of the index, or as NU1101 when the source resolves but returns nothing. Test the feed the way NuGet does:
curl -s -o /dev/null -w "%{http_code}\n" \
-u "$GH_ACTOR:$GH_TOKEN" \
https://nuget.pkg.github.com/acme/index.jsonIn CI, prefer credentials from environment variables with the documented variable names (NuGetPackageSourceCredentials_<name>, VSS_NUGET_ACCESSTOKEN for Azure Artifacts) over a committed nuget.config with a password in it.
4. Central package management changes where versions live
With Directory.Packages.props, versions come from PackageVersion items, and a <PackageReference> that also sets Version produces NU1109 or an unexpected resolution. NU1101 appears when the package is listed in neither file:
<!-- Directory.Packages.props -->
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Serilog.Sinks.File" Version="7.0.0" />
</ItemGroup>
</Project>The project then references the package with no version. A missing PackageVersion line is the equivalent of a missing entry, and the error still says the id does not exist.
5. Prerelease and unlisted versions
An id with only prerelease versions is not found without a prerelease flag, and a version that was unlisted months ago cannot be restored by range unless it is pinned exactly and still in the feed:
dotnet add package Serilog.Sinks.File --prerelease
dotnet add package Serilog.Sinks.File --version 7.0.0-rc.1dotnet package search <id> --source nuget.org lists what the source actually exposes, which separates "wrong id" from "wrong version" in one step.
6. Offline and air-gapped builds
A restore that must not reach the internet needs either a local folder source or a fully populated global packages folder. A local feed is the simpler contract:
dotnet restore --source ./packages
# or, permanently
dotnet nuget add source "$PWD/packages" --name localCopy the .nupkg files into ./packages in a step that runs where the network exists, and keep the folder free of extracted contents. For a container build, copy the folder before dotnet restore so the layer is cached.
To see exactly which source answered, and with what, compare a working and a failing restore log in Text Diff: the source name appears in each query line, and the missing one is obvious. When the failing item is an environment variable such as NUGET_PACKAGES or a proxy setting, check the resolved values in Environment Variable Inspector rather than trusting the shell profile.
Common Compilation/Runtime Mistakes & Version Gotchas
- Deleting the global packages folder as a first step. It re-downloads everything, takes minutes, and changes nothing about a missing source.
--no-restorein CI after adding a package. The restore never runs, and the error appears later as a missing reference or a compile error.- A committed
nuget.configwith cleartext credentials. Rotate the token and move it to a secret-backed environment variable. - Case and whitespace in package ids. Ids are case-insensitive but not whitespace-insensitive, and a trailing space in an XML attribute is invisible in review.
- A
RestoreSourcesMSBuild property that overrides the config. It replaces the source list rather than adding to it, so public packages vanish in that pipeline only. - Downloading a package manually and dropping the DLL in. The reference works until a transitive dependency is missing; reference the
.nupkgthrough a local source instead. - SDK version drift. A newer SDK may change the default
TargetFrameworkresolution and re-evaluate package compatibility;global.jsonkeeps the restore reproducible.
Primary references: NU1101 in the NuGet error reference lists the causes and the source checks, and package source mapping documents how ids are routed to a specific feed.
Official references
primary documentationThe C# documentation that defines the behaviour this guide explains.
Try matching browser tools
All toolsSmall utilities that fit C# work — they run entirely in this browser tab, so nothing you paste leaves your device.
Related C# guides
All C# guidesC# await vs Task.Result: Avoid Blocking Async Code
c# await vs task result: Understand the difference between await and Task.Result in C#, why blocking on async tasks can cause deadlocks, and when it's acceptable.
System.Text.Json: The JSON value could not be converted to a type
The serializer refuses to coerce. Read the exception path, then add a converter for dates, number handling for quoted values, or an enum converter.
.NET DI: Unable to resolve service for type while attempting to activate
Read the two type names in order, then check registration, namespace and lifetime. Includes the scoped-into-singleton follow-on error.
dotnet: A compatible .NET SDK was not found (global.json)
The message names the file and the missing band. Relax rollForward, pin an installed version, or remove the second pin in CI.
More in C#
All C# guidesThe guides filed next to this one in C#, in library order.