Sources, Feeds & Mapping
You list two servers in a config file, run `dotnet restore`, and whichever answers first hands over the package. Swap their order in the file and the result can change on its own, because the order was never a ranking.
- ▸Reorder your feeds all you like: restore ignores the order and takes whichever server answers the request first.
- ▸A repo
nuget.configthat adds one private server is still quietly racing nuget.org, until one line removes it. - ▸The same package name on two servers is an open door; source mapping locks which one may answer.
A nuget.config can list several servers to pull packages from:
<packageSources> <add key="contoso" value="https://pkgs.contoso.example/v3/index.json" /> <add key="nuget.org" value="https://api.nuget.org/v3/index.json" /> </packageSources>
Each <add> is a package source. Run dotnet restore and it is tempting to read that list top-down: first server wins, second is a fallback. It does not work that way. Restore asks every enabled source for the package at once and takes the answer from whichever one responds first. The order you wrote them in is ignored.
When a package id lives on exactly one source, the race has one entrant and the outcome is obvious. When the same id lives on two, the winner is whichever replies fastest on that run, which can differ machine to machine. The list was never a ranking. It is a set of package sources restore queries in parallel.