Using Nuget Without Nuget?

For a project I’m using VS2010 express, and needed the Google drive apis, which are available on Nuget. Except that Nuget (despite their claims) does not install on 2010 express.

Solution? Two actually, depending on how complicated the transfer is:

Solution #1: For small files, no nasty dependencies. Quick and simple.

  • Sign up and log into Nuget.
  • Find the package manually (ie, “search”)
  • Along the left, the “How to Download” link has become “Download”
  • Download the files (blahblahblah.nupkg)
  • Unzip it (rename it to .zip, or just right-click+save if available).
  • Add the /package/ dir to your project directory.
  • Add project reference(s) to whatever files you’re using in that dir.

Solution #2: For large interconnected groups and interdependencies, like I found with Google (which linked all over Heaven and Earth):

  • Get a Visual Studio that can use Nuget (if nothing else, VS2013 Express does.)
  • Install Nuget, etc.
  • Create a new project.
  • Find the package, and follow the site’s directions to download it, which will also take care of references, dependencies, etc.
  • Close that project.
  • Copy the /packages/ directory over to your original (old) project – make sure it’s to the same location relative to the old project as it was to the new (so the relative paths stay the same).
  • Open both project’s *.vbproj files.
  • Copy over the new reference entries (keep a backup of the file just in case). The reference entries look like this:
    <ItemGroup>
    <Reference Include="Google.Apis">
    <HintPath>packagesGoogle.Apis.1.9.0libnet40Google.Apis.dll</HintPath>
    </Reference>
    ...etc
    </ItemGroup>
  • Save and open. At this point the references should exist, and the files all grouped together.
  • Save everything. With it all grouped into one package, you can now say “buh-BYE” to Nuget.

I think it’s a sad commentary on the world today that there’s another layer of “help” being embraced that just further complicates matters. I’ve had no problem downloading code from a .zip file and using it until now – so why Nuget? Using Nuget means poor access to older Visual Studio (I can’t run it from VS Express, and can’t buy older Pro versions), so it does seem to be effective in “helping” people upgrade to the latest (likely paid) VS. And of course, it helps with dependencies – but whatever happened to including ALL files and a demo program together in one package? After all, that’s what I’m going to end up having to do with this code…

Comments are closed.