Well, not really. A better title would be "How to Cobble Together NuGet Support for Visual Studio 2008 with External Tools and a Prayer." The point is, there are lots of folks using Visual Studio 2008 who would like NuGet support. I'm exploring this area and there's a half-dozen ways to make it happen, some difficult and some less so. The idea would be to enable some things with minimal effort. It'll be interesting to see if there are folks in the community who think this is important enough to actually make it happen. Of course, the easiest thing is to just use 2010 as it sill supports .NET 2.0, 3.0, 3.5, and 4, but not everyone can upgrade.
But that's coulds and maybes. Let's talk about the MacGyver solution.
Launch Visual Studio 2008 and go to Tools | External Tools.
Make a new Tool with these values:
Next, right click in the Tookbar area and create a new Toolbar called NuGet. From Commands, drag in the correct Tools | External Tool button. Right click it and design to taste:
Now, when you click Install Package, you should change your.package.name to whatever the you want is, and click OK. Note the output in the console window below.
At this point, because we are only integrating the command line too, you don't get the references added automatically. And where's the packages? Well, they are here, one directory up under Packages. It's still up to you to add the reference yourself and make sure it's the appropriate one (I refer you again to the wish list above.)
If you are feeling extra fancy, you can even add a few macros and links in your Toolbar to send you to the NuGet site for searching. Here's a Visual Studio 2008 macro that launches your default web browser and takes you to http://www.nuget.org/List/Packages.
Public Module NuGet Sub LaunchNuGetSite() Dim p As New System.Diagnostics.Process() p.Start("http://www.nuget.org/List/Packages") End SubEnd Module
Then make toolbar buttons for those extra buttons, like this one for going to the NuGet site and searching:
Thoughts, Dear Reader?
Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. I am a failed stand-up comic, a cornrower, and a book author.
Who wants to use VS2008 anyway these days?
Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.