• subscribe
March 09, 2011 06:31 AM

The Marvels of NuGet

How Don Kiely got hooked on Microsoft's package management extension to Visual Studio
Dev Pro
InstantDoc ID #129852

Microsoft has been making a lot of noise lately about NuGet, their still-new package management extension to Visual Studio. I have to admit that I just didn't "get it" for quite a long time after they announced it. It seemed like a nice little feature, but not worth anywhere near the attention it was getting. So it finds and automatically installs packages into a project. That's kind of nice, but it just didn't rock my world.

Okay, so maybe I'm a bit slow on the uptake on some things. But last week I was forced to sit through a few sessions about it, scattered over a few days at a conference. Well, maybe "forced" is too harsh a word—I would have picked other topics at those times had any interesting ones been available. As it was, I was dragged, initially kicking and screaming but later quite willingly, into the fold of NuGet believers. This is one rockin' cool tool.

Officially, NuGet is a free, open source package management system that simplifies incorporating third-party libraries into a .NET application (not just ASP.NET). That description is a bit dull—which might be why I didn't catch on to NuGet for a while. In reality, NuGet is a way to download and install just about any kind of components that someone cares to package together in a form NuGet can work with. Once the package is uploaded and you've installed NuGet in Visual Studio, you can search for and automatically download and install the package in a project. And it's that last part that is the best part: A properly designed package will do whatever is necessary to get the library configured for you. That might mean adding some elements to the project's config file, putting files in their proper locations within the project, or whatever else is necessary. No longer do you need to do manual installations to get things working right, so you're free of all the tedious work needed to get things set up. And if a package has any dependencies, NuGet can install the dependencies as well. Automatically.

Packages I've Used with NuGet
I have to admit that the packages that got my attention, even though they aren't themselves hard to install, are the jQuery Library and quite a few jQuery extensions. In the figure below, I've started NuGet from Visual Studio, selected the Online tab on the left, and searched for "jquery" in the search box in the upper right. As you can see on the first of five pages or results, you can automatically install the core jQuery Library and the current vsdoc file for IntelliSense in the JavaScript editor in Visual Studio, as well as various other plug-ins. What's really interesting is that someone on the jQuery UI Team has taken the time to put together NuGet packages for the major components of jQuery UI, saving you the trouble of going to the jQuery UI website and building your own custom download and installing it manually.

NuGet packages for jQuery components
NuGet packages for jQuery components




ARTICLE TOOLS

Comments
    There are no comments to display. Be the first one!
You must log on before posting a comment.

Are you a new visitor? Register Here