NU1101 package‑not‑found error with packageSourceMapping element
0 reputation · 25 Aug 2022, 22:30 UTC
Goal: Reduce restore costs for a low‑traffic workload
In a scenario where a project has minimal traffic, the objective is to keep .NET restore operations on an internal or cached feed to avoid egress charges from the public NuGet feed. The configuration relies on packageSourceMapping entries in nuget.config, pairing packagePattern values with specific packageSource keys.
Unresolved decision: global fallback pattern
When a package ID does not match any defined packagePattern, the restore can either fail with a NU1101 error or silently fall back to a default source if a global wildcard pattern (e.g., *) is present. The choice between these behaviors impacts cost, reliability, and security.
What is the effect of adding a global * fallback pattern on restore traffic and cost? How does the absence of a global fallback affect packages that are not explicitly mapped? When using dotnet restore versus nuget.exe, how does packageSourceMapping behavior differ regarding fallback patterns?