Cannot find the latest version of a package on NuGet
1) First,check whether you have nuget.org
enabled as the data source of the package source. The ClientDependency
nuget package is under nuget.org
.
Tools-->Options-->Nuget Package Manager-->Package Sources--> and make sure that you enable that link.
Also, check nuget.org in nuget package management UI.
2) Second, unload your project and enter xxxx.csproj
file, please check whether your reference xml elements have allowedVersions
node like this:
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" allowedVersions="[12.0.1]" />
</ItemGroup>
allowedVersions
specifies the version range of this nuget package, []
is equivalent to =
, which means that the current nuget can only be this version. (,12.0.3]
means version <=12.0.3
.
So please check your xxxx.csproj
file. I suggest you could delete allowedVersions
node if not necessary.
3) Third, I found that ClientDependency nuget package only has one version 1.9.9
and it seems that it abandons 1.8.4
and in my side, l cannot get version 1.8.4
.
Perhaps it is because ClientDependency
already exists as a brand new version 1.9.9
. As for the old 1.8.4
package, it may be broken, and the 1.9.9
version package cannot be captured.
So please search ClientDependency
in the nuget package management UI and find out whether you can get version 1.9.9
. After it, please uninstall ClientDependency 1.8.4
and then install the new version 1.9.9
.
I'd prefer to have it updated via the package manager console, so that
some automatic code updates can be applied,
In addition, if you want to install the package version 1.9.9
by Package Manager Console. You can try these:
1) If your issue is as tip one and two said, you can use this in Package Manager Console:
Update-Package ClientDependency -Version 1.9.9
2) If as tip 3 said:
You should first uninstall the old version and then install this new package:
uninstall-package ClientDependency -Force
Install-package ClientDependency -Version 1.9.9