Kannan
Kannan

Reputation: 56

NuGet restore with latest version

Referring a NuGet package with the version of 1.0.1 from our local NuGet feed. Later pushed the next version of package 1.0.2. When using NuGet restore or update it works well.

Removed the older NuGet package of version 1.0.1 but the package.config still referring the version 1.0.1.

Now, NuGet restore looking the version 1.0.1. It can't upgraded to 1.0.2 (or latest version which available).

Included the allowedVersions in package.config with

<package id="packagename" version="1.0.1" allowedVersions="[1,)" />

Can you suggest to install the latest package if mentioned version not available in corresponding feed?

Upvotes: 2

Views: 2340

Answers (1)

Martin Ullrich
Martin Ullrich

Reputation: 100581

packages.config only allows a single version of a package to be specified. In your case you will need to update the package using the package manager UI in VS or the Update-Package command in the package manager console.

The allowedVersionsattribute only prevents these two methods from upgrading beyond the specified version range.

Upvotes: 1

Related Questions