Skip to content

How to limit update-package to jquery 1.x in nuget Visual Studio

2013 July 15

jQuery 2.x does not work with IE 6, 7, 8 so to keep the nuget “update-package” command from updating to 2.x, you need to edit the existing jQuery line in your packages.config file.  This file is in the root of your application.

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

You can quickly find the pacakges.config by using the search functionality in the Solution Explorer (pic)

packages

 

I’m using Visual Studio 2012, with .NET 4.5.  You might have to change the targetframework if you are using an older framework.

4 Responses leave one →
  1. Alex permalink
    July 25, 2013

    That didn’t work
    Nuget just ignores the allowed version and install the latest one :(

  2. mark permalink*
    July 25, 2013

    Sorry to hear that it didn’t work for you, Alex. Can you verify that the end of your allowedVersions ends with a ) and not a ]. The ) tells the system to not include version 2. So it looks like: allowedVersions=”[1.10.1,2)”

  3. mark permalink*
    July 25, 2013

    Two other things to try:

    – You could also try a lower minimum version: allowedVersions=”[1.9.3,2)”

    – Make sure that there aren’t 2 lines in your packages.config for jQuery

Trackbacks and Pingbacks

  1. How to update jQuery in a Visual Studio Project (MVC 4) | yakimadev.com

Leave a Reply

Note: You can use basic XHTML in your comments. Your email address will never be published.

Subscribe to this comment feed via RSS