简体   繁体   中英

Nuget Update-Package not finding new versions of packages

I have a product with multiple services that have many solutions each. In order to reference things across services we are using Nuget to download and reference the dlls. Since we are still in early development of this product there are a lot of changes to the core dlls and we are having a lot of merging issues and annoyances with updating the references.

I tried using Update-Package -ProjectName XProject -Safe thinking this would do exactly what I wanted it to, update all the references with the same Major/Minor version. However, it just skips over all the files saying they are updated. When I look in Nuget it clearly notices that there is a new version so I am unsure what the problem is...

No updates available for 'Framework.EntityModel'.
No updates available for 'Framework.Core'.

in packages.config:

<package id="Framework.Core" version="1.0.14030.1137" targetFramework="net45" />
<package id="Framework.EntityModel" version="1.0.14030.1137" targetFramework="net45" />

There are versions in nuget with the label: 1.0.14034.1137 so I don't know why it isn't picking them up. I can open up package manager and update from there fine. I just want a way to easily update every reference without doing things manually.

This is taken from the Versioning page of NuGet @ the bottom of the page:

Dependencies are no longer unnecessarily updated during package installation

Before NuGet 2.5, when a package was installed that depended on a package already installed in the project, the dependency would be updated as part of the new installation, even if the existing version satisfied the dependency.

Starting with NuGet 2.5, if a dependency version is already satisifed, the dependency will not be updated during other package installations.

The scenario:

The source repository contains package B with version 1.0.0 and 1.0.2. It also contains package A which has a dependency on B (>= 1.0.0).

Assume that the current project already has package B version 1.0.0 installed. Now you want to install package A.

In NuGet 2.2 and older:

When installing package A, NuGet will auto-update B to 1.0.2, even though the existing version 1.0.0 already satisfies the dependency version constraint, which is >= 1.0.0. In NuGet 2.5 and newer:

NuGet will no longer update B, because it detects that the existing version 1.0.0 satisfies the dependency version constraint. For more background on this change, read the detailed work item as well as the related discussion thread .

Edit:

The above explains why you may be experiencing your issue, but to actually help to resolve it, take a look at http://blog.nuget.org/20131216/update-all-experience-explained.html . It shows you how you could use the DependencyVersion parameter of Install-Package or override the default behaviour in your nuget.config file to use "HighestPatch".

See the Install-Package section of http://docs.nuget.org/docs/reference/package-manager-console-powershell-reference for more information.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM