Reputation: 31520
If I have 2 sources in my nuget file (internal sources) and in both of those sources I have a package with the same name and version which source will nuget pull the package from? Will it be the source listed first?
It normally wouldnt matter but lets say I have two packages with the exact same name and version but the package itself is actually different.
Upvotes: 0
Views: 2594
Reputation: 76670
what if I have duplicate nuget packages in multiple sources?
When you open NuGet Package Manager setting, Tools->Options->NuGet Packager Manager->Package Source, you will notice that there are up and down arrows for package source:
NuGet Package Manager will give priority to search package in the top of the package source list.
However, this priority can easily be broken by order of the quickest response and different version. Just like Matt said "NuGet 3 and above they are tried in parallel". So when one of your package source reacts significantly faster than others, the priority will be broken, the quickest response package source will be used.
Besides, priority will given to package sources which contain a higher version of the package.
As suggestion, since your packages itself are actually different, I suggest you can give them different name or different version.
Upvotes: 3