Question
NuGet.Config precedence: project‑level vs solution‑level packageSources
Lax Moss
0 reputation · 24 Jul 2021, 05:53 UTC
143.1K views0
Goal
Determine which NuGet.Config file is consulted when a project and its solution both define the same packageSources key.
Uncertainty
The official precedence list states that project‑level settings should override solution‑level ones, yet the documentation does not clarify whether the value is replaced or merged. In practice, when both files contain a packageSources entry, the restore log sometimes shows duplicate URLs, suggesting a merge rather than an override.
Questions
- When a project and its solution both specify
packageSources, does the project value fully replace the solution value, or are the two lists concatenated? - Does the order in which the configuration files are discovered influence the final source list?
- Is there a documented configuration option to force a project to ignore the solution‑level
packageSourcesentry?