Using ASP.MVC 3 + Nuget, I've added packages, but this is the first time I've tried to update a package with dependencies. So far, I'm stuck...
Created a brand new ASP.MVC 3 application. Wanted to upgrade jQuery to version 1.6 from the default jQuery 1.5.1.
In the the Package Manager Console:
PM> install-package jquery
Successfully installed 'jQuery 1.6'.
Install failed. Rolling back...
Install-Package : Conflict occurred. 'jQuery 1.5.1' referenced but requested 'jQuery 1.6'. 'jQuery.vsdoc 1.5.1, jQuery.Validation 1.8.0, jQuery.UI.Combined 1.8.11' depend on 'jQuery 1.5.1'.
Is there a different syntax to update a package? Do I need to remove all those dependent packages and re-add them?
Oh why so complicated? Simply open the ~/Views/Shared/_Layout.cshtml
file and replace:
<script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
with:
<script src="@Url.Content("~/Scripts/jquery-1.6.min.js")" type="text/javascript"></script>
after downloading jquery 1.6 and including it in your Scripts
folder obviously.
Of course if you are using a CDN (which is what you should by the way if your site is publicly facing) then simply open ~/Views/Shared/_Layout.cshtml
and replace:
<script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
with:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js" type="text/javascript"></script>
and that's pretty much all you're gonna need.
Before updating jQuery to version 1.6, you'll need to upgrade those packages to a version that supports jQuery 1.6.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With