'Visual Studio CLI cant install specific NuGet package version
I am in Visual Studio 2019, and when I open the package manager console, I can run:
nuget install MartinTestPkgXYZ
which will succeed and install the latest version (2.0.0), but I want to only install version 1.0.0. To my knowledge I can't do this with nuget install
, but if I run:
Get-Package -ListAvailable -Filter MartinTestPkgXYZ -AllVersions
it shows the following versions:
Id Versions Description
-- -------- -----------
MartinTestPkgXYZ {2.0.0, 1.0.0} Package Description
So I want to install version 1.0.0 and I run Install-Package MartinTestPkgXYZ -Version 1.0.0
, which fails with the following error:
Install-Package : NU1108: Cycle detected.
MartinTestPkgXYZ -> MartinTestPkgXYZ (>= 1.0.0).
At line:1 char:1
+ Install-Package MartinTestPkgXYZ -Version 1.0.0
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
Install-Package : Package restore failed. Rolling back package changes for 'ClassLibrary2'.
At line:1 char:1
+ Install-Package MartinTestPkgXYZ -Version 1.0.0
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
Why is my command failing? Can I not install older versions in visual studio using the command line?
I've tried clearing my nuget cache in visual studio 2019 using the UI, and running the command nuget locals all -clear
but still face the same error message.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|