Proper way to update packages that won't load in VS2010 due to missing items?

Topics: General
May 18, 2012 at 6:09 AM


  I've got packages that modify the project file and include links to files with additional msbuild rules. I then insert everything but the packages themselves into my source control. Up to now, I've never copied the msbuild rule files into the package, but now I'm wondering.

  The problem comes when I check the solution out onto a new machine. I can't open it in VS2010 because those msbuild files don't exist, and can't be loaded by VS2010. And the package manager (right click on the solution, nuget package manager) doesn't see the unloaded project files.

  So, I have to drop back to the command line. And in the command line it looks like I have to run "nuget install" for each project.

  So, perhaps two requests - which may be implemented and I just don't know it yet:

  1. Some way of auto-downloading packages early on? Perhaps part of the VS2010 start up? But you may not want to inflict this on everyone that uses nuget - as it has got to be a very small minority of people that will need this feature.
  2. Add something to nuget that makes it easy to update and install all packages for a solution in the way that VS2010 is designed to do? Perhaps "nuget install dude.sln" and that scans for all projects and then looks for the packages.config file? Or you could add with a small installer the ability to right click on a .sln file and add a "install all referenced nuget pacakges" command. :-)

In the meantime, to show you exactly what I mean... :-), I've been using the following ps command to do what I need:

> Get-ChildItem -Recurse . | ? {$_.Name -eq "packages.config"} | % {.\.nuget\nuget.exe install "$($_.FullName)" -OutputDirectory Pacakges}

Thanks! -Gordon.