Tests package restore for floating package versions.
- package/Test.Package: a nuget package that gets published to nuget.org
- project/Test.Project: a project that references version 1.0.* for the above package
This repository is intended to reproduce the issue described at NuGet/Home#7198.
To reproduce this issue, you'll be:
- Building a project with the current package version published to NuGet.org
- Publishing a new package version to NuGet.org
- Waiting for a period of time
- Building the project again
Step 4 fails to restore the new package version, even after waiting several hours for the nuget http-cache to expire.
In project/Test.Project:
dotnet restore --no-cachedotnet builddotnet run
Note the output: "Current Package Version 1.0.X"
In package/Test.Package:
- Increment patch level for Version and AssemblyVersion in Test.Package.csproj
dotnet nuget pack -o .dotnet nuget push .\*.nupkg -k oy2nske6pevupvmtvivqxrsk2baleizu3brb3i75vkgfie
Verify listing at https://www.nuget.org/packages/mpetito.test.nuget/
- Wait for validation so the package is available for restore
- Wait for nuget http-cache expiration, at least 30 minutes
In project/Test.Project:
dotnet restoredotnet builddotnet run
Note the output, which shows an old version and indicates the newest version was not restored as expected:
Current Package Version 1.0.X
Expected output, which should show the newest version:
Current Package Version 1.0.(X+1)
To verify that restore should see the new package version:
dotnet restore --no-cachedotnet builddotnet run
Verify the output now shows:
Current Package Version 1.0.(X+1)