Description
Download of older versions of NuGet packages using the Visual studio NuGet package manager console doesn't work unless the packages are already cached in Nexus.
PM> Install-Package -Id Google.ProtocolBuffers -Version 2.3.0.277
Install-Package : Unable to find version '2.3.0.277' of package 'Google.ProtocolBuffers'.
At line:1 char:16
+ Install-Package <<<< -Id Google.ProtocolBuffers -Version 2.3.0.277
+ CategoryInfo : NotSpecified: ([Install-Package], InvalidOperationException
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
This fails. But then download it directly into Nexus via GET request:
curl http://localhost:8081/nexus/service/local/nuget/nugroup/Google.ProtocolBuffers/2.3.0.277 > /dev/null
After this the download from PM works:
PM> Install-Package -Id Google.ProtocolBuffers -Version 2.3.0.277
Installing 'Google.ProtocolBuffers 2.3.0.277'.
Successfully installed 'Google.ProtocolBuffers 2.3.0.277'.
Adding 'Google.ProtocolBuffers 2.3.0.277' to SonatypeNexusCSharp.
Successfully added 'Google.ProtocolBuffers 2.3.0.277' to SonatypeNexusCSharp.
The query which fails (and then succeeds) is: