Why NuGet for Visual Studio 2010 is so useful!

Recently I delivered a session at Virtual TechDays on why NuGet is so useful.   As a part of the demonstration, I was showcasing how it automatically allows us to update some of the external reference libraries.  Point in case, here is jQuery.

Starting Visual Studio 2008 SP1, we have been shipping jQuery and intellisense for jQuery thereof.  With Visual Studio 2010, out of the box, when we create a “File – New Project – ASP.NET Web Application” (which would create a Webforms application) it would automatically add the jQuery script files for jQuery 1.4.1 version.  This was the then latest version of jQuery when we shipped Visual Studio 2010 way back in early 2010.

With the new ASP.NET MVC 3 Tools Update that was shipped in April, this year, when you create a “File – New Project – ASP.NET MVC3 Web Application” it automatically adds references to the jQuery-1.5.1.js and the respective minified file and the vsdocs (intellisense) files.

image 

Now, jQuery is something that evolves quite faster compared to versions of Visual Studio.  So, there is no real chance that we could always publish the latest version of jQuery automatically into your projects unless we release a new version of Visual Studio every month Smile with tongue out

With NuGet, I can always use “Manage NuGet Packages”

image

and it opens up the updated versions of the NuGet Packages

image

and notice that when I click jQuery, it shows that there is a recent version 1.6.4 shipped on 22nd September available.  When I clicked install, it did 2 things.  One, it downloaded the latest bits.  It also neatly removed the existing 1.5.1 files before adding the newer ones.

image

What it did not do automatically though was changing the references for the script file in the Layout.cshtml file in the project.  That still we have to change manually.  Now, with this, I could use the latest version of jQuery available from NuGet.  Same is the case with modernizr and other open source libraries which have an agile update model.

You can download NuGet from http://nuget.org

Cheers!!!

Print | posted on Friday, September 30, 2011 7:50 PM

Comments on this post

# Why NuGet for Visual Studio 2010 is so useful!

Requesting Gravatar...
The post on the latest nugget for visual studio proved to be an interesting one. These posts shared here on the page will be much useful to the visitors who are interested in the technical details of computers. Keep up the good work sell my miles
Left by Ocho on Oct 30, 2015 3:31 PM

# re: Why NuGet for Visual Studio 2010 is so useful!

Requesting Gravatar...
I was searching articles on Visual studio and the things dealing with it. Then I found this article and I would like to say a big thanks to this site for this informative piece of writing. Hope you people will share more articles like this.
cryotherapy near me
Left by Merlin John on Jun 13, 2016 5:59 PM

# re: Why NuGet for Visual Studio 2010 is so useful!

Requesting Gravatar...
this is really awesom .
http://spanishlovethings.tumblr.com/
Left by vishal on Jan 23, 2017 2:33 PM

# re: Why NuGet for Visual Studio 2010 is so useful!

Requesting Gravatar...
HLW ,
http://spanishlovethings.tumblr.com/
Left by vishal on Jan 30, 2017 1:11 PM

# re: Why NuGet for Visual Studio 2010 is so useful!

Requesting Gravatar...
HLW.. database sql books EVERYONE
Left by vishal on Jan 30, 2017 11:32 PM

# re: Why NuGet for Visual Studio 2010 is so useful!

Requesting Gravatar...
HIIIII...... database sql books EVERYONE
Left by vishal on Jan 30, 2017 11:33 PM

Your comment:

 (will show your gravatar)