Visual Studio, Nuget package sources, Order doesn't stick
Visual Studio, Nuget package sources, Order doesn't stick
So this is indeed a bug in the VS 2017 and VS 2019 UI, in that it sometimes (often?) can't save your chosen order. I poked around a bit, having been bitten by the same bug today myself, and the good news is that you can fix the package order yourself, outside of Visual Studio, because it's just stored in a text file on disk.
Close Visual Studio, and then go into C:\Users\[your name]\AppData\Roaming\NuGet\
, and you'll find a NuGet.Config
file that contains XML that looks something like this:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="Microsoft Visual Studio Offline Packages" value="C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\" />
<add key="My Local Packages" value="C:\Code\NugetPackages" />
...
</packageSources>
...
</configuration>
Notice that those <add ... />
elements exactly match what you see in the Nuget Package Manager UI, in the same order. So you can manually reorder the <add ... />
elements in this file to whatever order you want your package sources in, and save it; and both Nuget and Visual Studio will respect the new order you've chosen.