A lot of people involved in web development (including myself) have hit a problem with the latest versions of jQuery. Right now there are two versions of jQuery available on NuGet – 1.9.1 and 2.0.x. According to the jQuery team, both versions will be developed in the future and for developers targeting web applications the recommended version is 1.9.1 instead of 2.0 (jQuery UI for example does not work with v2.0).
By default NuGet will install the latest version of jQuery automatically. Of course, if you use the Package Manager Console, you can force version 1.9.1. But as soon as you update and you forget to do a safe update (see my previous post here on how to do that), you are stuck with version 2.0.
To prevent such issues, an easy solution is to force the package to stay under version 2.0 by changing it in the packages.config file like this:
<package id="jQuery" version="1.9.1" targetFramework="net45" allowedVersions="[1.9.1,2)" />
The right parenthesis means that the allowed versions should go up to (but not including) version 2.0
In the nasty situation when you’ve already updated the version and you have also dependencies on jQuery, you can downgrade the version using the following Package Manager Console commands:
Uninstall-Package jQuery –Force Install-Package jQuery -Version 1.9.1
Remember to change the packages.config afterwards.