Australian cloud for business software — built and run in Sydney since 2002

NetLeverage
NetLeverage

NuGet NU1101 "Unable to find package": check the id, the configured sources and package source mapping

Technical article
Troubleshooting

About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.

NuGet error NU1101 reports Unable to find package 'PackageId'. No packages exist with this id in source(s): ..., which means NuGet searched the sources it was configured with and none of them has a package with that id. The fault is the id, the list of sources the build actually reads, or package source mapping that stops the right source from being searched. Our own reading: a restore on a build server can read different configuration from a developer's machine.

What the error means

Microsoft's NU1101 page describes two forms. The first: "Unable to find package 'PackageId'. No packages exist with this id in source(s): sourceA, sourceB, sourceC". The issue it names is "The package cannot be found on any sources."

The second form adds package source mapping: "Unable to find package 'PackageId'. No packages exist with this id in source(s): sourceA PackageSourceMapping is enabled, the following source(s) were not considered: sourceB, sourceC." Its issue reads "The package cannot be found on any of the PackageSourceMapping configured sources." In that form, the message itself lists the sources that mapping excluded.

Microsoft's source mapping page says: "By default, NuGet will search all configured package sources when it needs to download a package." Mapping, added in NuGet 6.0, filters "per package, which source(s) NuGet will search". Once a packageSourceMapping element exists, the page says every requested package, "including transitive packages", must match a defined pattern.

In both forms the page's solution text says to examine the project's dependencies in Visual Studio "to be sure you're using the correct package identifier and version number". Our own reading: a package that exists on a source but not in the version you asked for is reported under a different error code, which this guide does not cover.

Likely causes

Cause What you see How to confirm
The package id is misspelt or the package is not published Id in the error does not exist on any listed source Check the id exactly as the feed shows it
The source that has the package is not in the configuration the build reads The source(s): list lacks your private feed dotnet nuget list source from the repository folder
A <clear /> in a repository config removed inherited sources Only the sources named in that file appear Read the packageSources section of each config
The source is disabled The source is configured but not searched disabledPackageSources section
Package source mapping excludes the source The second message form, with "were not considered" packageSourceMapping section
A package that uses Semantic Versioning 2.0.0 is requested from a feed that is not the V3 feed The package is not found on that source Our own reading: the source address is not the V3 feed that Microsoft's page names
The config file is in the wrong folder Settings seem ignored Config location against the table on Microsoft's page

Prove the cause before changing anything

All of these only read.

1. Read the whole error line. Note the package id in quotes, the sources listed after source(s):, and whether the text "PackageSourceMapping is enabled" appears.

2. List the sources NuGet reads from where the restore runs. Run it in the repository (solution) folder, on the same machine or agent that failed. In the commands below, nuget.config means the file in that folder. Microsoft's page says the command lists "all existing sources from your NuGet configuration files" using the hierarchy of configuration files from the current directory:

dotnet nuget list source

Compare the list with the source(s): part of the error.

3. Find the configuration files. Microsoft's configuration page says settings come from solution, user and computer levels, and that "if a config file is placed in a project folder, it has no effect on that project", and that restoring a project on the command line treats the project's directory as the solution directory, so results can differ between project and solution restores. Per that page the user file on Windows is %appdata%\NuGet\NuGet.Config and on Mac and Linux ~/.nuget/NuGet/NuGet.Config or ~/.config/NuGet/NuGet.Config, depending on tooling. Our own advice, built from those locations, on Linux or macOS:

ls -la nuget.config NuGet.Config ../nuget.config ~/.nuget/NuGet/NuGet.Config

4. Read the mapping and disabled sections.

grep -n -i "packageSourceMapping\|disabledPackageSources\|clear" nuget.config

5. Check the feed address. The page says that for Semantic Versioning 2.0.0 packages you should use the V3 feed, https://api.nuget.org/v3/index.json.

Fix

Fix only the cause the checks showed. A repository nuget.config at the repository root is, per Microsoft's page, the recommended place for shared settings. Always pass --configfile so that the file you saved is the file that changes.

Three causes in the table depend on which files and feeds your organisation owns: a <clear /> that removed inherited sources, a Semantic Versioning 2.0.0 package requested from a feed that is not the V3 feed, and a config file in the wrong folder. The checks above and the V3 address show which applies; decide the change with whoever owns the build configuration.

Correct the package id

First save the current state:

cp -p App.csproj App.csproj.2026-12-03

Risk: the next edit changes which package the project restores, so builds use different code if another package with the new id exists.

Change the id in the project's package reference, so that it matches the id the feed shows. The NU1101 page also names Visual Studio's dependencies as a place to examine the package identifier and version number.

To undo it, only if you need to: the copy below overwrites the current App.csproj, so any other edit made to the project file since the save is lost, and the project goes back to the old package id. Copy the saved file back.

cp -p App.csproj.2026-12-03 App.csproj

Add the missing source

This uses an existing nuget.config. First save the current state:

cp -p nuget.config nuget.config.2026-12-03

Risk: the next command adds a package source to nuget.config, so every restore that reads this file searches it too. Microsoft's page warns: "When adding multiple package sources, be careful not to introduce a dependency confusion vulnerability."

dotnet nuget add source https://packages.example.com/v3/index.json --name example-feed --configfile nuget.config

To undo it, only if you need to: the copy below overwrites the current nuget.config, so any other edit made to it since the save is lost, and restores stop searching the added source. Copy the saved file back, then list the sources.

cp -p nuget.config.2026-12-03 nuget.config
dotnet nuget list source --configfile nuget.config

Enable a disabled source

First save the current state:

cp -p nuget.config nuget.config.2026-12-03

Risk: the next command enables a source in nuget.config, so restores start using it, including for packages it should not supply.

dotnet nuget enable source example-feed --configfile nuget.config

To undo it, only if you need to: the copy below overwrites the current nuget.config, so any other edit made to it since the save is lost, and restores stop using the source again. Copy the saved file back.

cp -p nuget.config.2026-12-03 nuget.config

Adjust package source mapping

First save the current state:

cp -p nuget.config nuget.config.2026-12-03

Risk: the next edit changes which source may supply packages matching a pattern, for every project that reads this file. Microsoft's page says patterns follow a precedence and that every package, transitive ones included, must match one. An edit with a mistake in the XML is dangerous: the configuration page says NuGet "silently ignores the entire configuration file if it contains malformed XML".

If the file already has a packageSourceMapping element, add only the package line, inside the right existing packageSource element, and do not add a second wrapper. The wrapper is shown below for context, as the nuget.config reference's example does:

<packageSourceMapping>
  <packageSource key="example-feed">
    <package pattern="Example.*" />
  </packageSource>
</packageSourceMapping>

To undo it, only if you need to: the copy below overwrites the current nuget.config, so any other edit made to it since the save is lost, and the pattern is no longer mapped to that source. Copy the saved file back.

cp -p nuget.config.2026-12-03 nuget.config

Example (illustrative): On ci01, a restore of example-org/example-repo ends with Unable to find package 'Example.Widgets'. No packages exist with this id in source(s): nuget.org. On a developer machine it works. dotnet nuget list source on ci01 shows only nuget.org; the private feed example-feed lives in a developer's user-level NuGet.Config. The team saves nuget.config, adds the feed to the repository file with --configfile nuget.config, and the restore on ci01 finds the package.

Confirm the fix

  1. dotnet nuget list source on the machine that failed now shows the expected sources.
  2. Run the project's usual restore or build on that machine. Microsoft describes dotnet restore as restoring "the dependencies and tools of a project". Our own reading: any restore downloads packages into the build machine's cache and writes restore output in the working folder.
  3. The NU1101 line no longer appears.

What to watch afterwards

  • Keep one repository nuget.config and avoid relying on user-level settings for a build.
  • When package source mapping is on, add a pattern for each new private package prefix.
  • Microsoft's page says older tooling ignores the mapping; keep build agents on .NET SDK 6.0.100 or later and NuGet 6.0 or later.
  • The source(s): list in a later error shows what the build really read.

Risks and limits

  • These commands have not been run or lab-tested.
  • Microsoft's NU1101 page is short and was last updated on 2 February 2022.
  • Authentication faults on a private feed are a different problem that this guide does not cover.
  • --configfile limits the command to one file; sources in other files still apply to restores.

Sources