问题
If you have multiple packageSources in your NuGet.config:
<packageSources>
<clear />
<add key="dev" value="http://server2/branches/feature1/nuget" />
<add key="release" value="http://server1/nuget" />
</packageSources>
Is the order in the XML used when running nuget install, etc? If I have packageA at version 1.0.0-SNAPSHOT in both, will the dev channel version on feature1 branch win?
回答1:
The order of your feeds in nuget.config determines the order that they show up in the drop down menus from the various views into NuGet from Visual Studio. In all cases, you have the choice of which feed you install from. See the screenshots below.
Visual Studio doesn't keep track of where your package came from, so the package ID is really in a global namespace that you have to know which feed it's a part of. Visual Studio will show you any package from the selected feed with a matching ID, so it's possible that you'd overwrite a package you installed from one feed with another from a different feed.
For a NuGet feed that I manage at my company, I prefix our internal packages with <CompanyName>.
so as to reduce the risk for a naming conflict now and in the future.
来源:https://stackoverflow.com/questions/36470532/nuget-packagesources-priority