Arikael
Arikael

Reputation: 2085

NuGet keeps ignoring "allowedVersion"

I'm using NuGet in VS 2013 and try to limit the JQuery Package to version 1.x (instead of 2.x) Here is what I have in my packages.conf

<package id="jQuery" version="1.11.2" targetFramework="net45" allowedVersion="[1,2)" />

Which to my knowledge tells nuget to exclude versions starting with 2

Now, when I run the following command in the console to see what would be updated.

Update-Package -ProjectName Website -WhatIf

it shows me

Updating 'jQuery' from version '1.11.2' to '2.1.3' in project 'Website'.
Remove 'jQuery 1.11.2' from project Website.
Add 'jQuery 2.1.3' to project Website.

Which is not what I expected. Why does nuget want to update to version 2.1.3 even when I said exclude this version.

Am I missing something here?

Upvotes: 0

Views: 542

Answers (1)

Matt Ward
Matt Ward

Reputation: 47937

This is not working because the attribute should be allowedVersions and not allowedVersion. The following entry in the packages.config file should as you are expecting it to.

<package id="jQuery" version="1.11.2" targetFramework="net45" allowedVersions="[1,2)" />

Upvotes: 1

Related Questions