Nuget msbuild task

Mar 15, 2011 at 8:55 PM

Hi,

I've just started looking at what I might need to do to get our CI server to download packages from nuget feeds as part of the build process, in order to simplify dependencies between projects.

As far as I can see, the library dependencies for each VS project get stored in the packages.config file.  So if I created a build task that parsed that file, and for each entry used the InstallCommand class to grab the required packges and place them in the default location, would that work?

I'm assuming that I specify the allowed repositories and so forth in some sort of config file that would live outside the build tree.  In this case, allowed repositories is likely to be some sort of internal nuget server containing specific controlled packages, rather than the live one on the internet.  I'm also assuming that the packages in question are pretty simple, basically sets of dlls, so no powershell installer steps or anything that might survive zapping the workspace.

I've written msbuild tasks before, and it does not sound too difficult ... so I must have missed something!  Can anyone help me out by thinking of why this won't work?

Thanks for your help, if it does work it will make my life a million times easier!

Miles

Developer
Mar 15, 2011 at 9:01 PM

http://blog.davidebbo.com/2011/03/using-nuget-without-committing-packages.html