1

I am trying to update a package known as ClientDependency, which is needed for a Umbraco-built website's security feature. This has to be updated to the latest version 1.9.9, which however cannot be found in NuGet.

I can only find 1.8.4 as the latest stable version in my solution, which is what I have been using for quite some time now.

Is there anyway I can update the package to the latest version? I'd prefer to have it updated via the package manager console, so that some automatic code updates can be applied, rather than copy-paste the dll manually from it source.

4

1 回答 1

2

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.

enter image description here

Also, check nuget.org in nuget package management UI.

enter image description here

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
于 2020-04-14T05:39:37.583 回答