Why NuGet Keeps Downgrading "Floating" Versions
Lee Timmins
9th Jan 2026
Comments
If you use floating versions in your .csproj (e.g., Version="1.*"), you may have seen an issue where you restore the latest version via the CLI, but as soon as you click Build in Visual Studio, it reverts to an older version.
The Problem: The 30-Minute Cache
NuGet is designed to stay fast by not hitting the network on every build. When you use a wildcard version, NuGet caches the "latest available version" metadata locally.
Running dotnet restore --no-cache forces a one-time check to the server, which bypasses the cache. However, Visual Studio’s still uses the standard cache. If that 30-minute window hasn't closed, VS will see the old version in its cache and "fix" your project by downgrading it back to the older version.
The Fix: Clear the HTTP Cache
You don't have to wait 30 minutes for the cache to expire. You can force NuGet to forget the old version list immediately by running:
dotnet nuget locals http-cache --clear