Using OctoPack with NuGet Package Restore

I recently started using Octopus Deploy to manage deployment across environments. They provide a NuGet package called OctoPack that makes it easy to create the required packages to deploy your app. OctoPack is basically just a set of MSBuild targets that get added as an import directive in your project file. This is all fine and good unless you are using the NuGet Package Restore workflow where you don’t commit your NuGet packages to source control. What you end up with is a chicken-and-egg scenario: Your project is set to use an MSBuild pre-build task to restore packages, but your project imports MSBuild tasks from one of those packages so you get a compilation error before it can restore the packages. To solve this problem you need to copy the MSBuild targets file for OctoPack to your project and commit it to source control. Luckily, the OctoPack project is available on GitHub so I forked it and updated it’s install script to handle all this for you. I have submitted a pull request to the author but if you just can’t wait I have also published an update to the package on the Geek Indulgence MyGet feed: http://www.myget.org/F/geekindulgence/. Just add this to your VS2010 Package Manager (via Tools > Options > Package Manager > Package Sources) and you can install the updated version of the package. UPDATE: Paul Stovell of Octopus Deploy has merged my pull request and pushed a new version of OctoPack to the official NuGet feed. Octopus Deploy is an awesome tool and I’ll be putting together a detailed post about using it very soon. Stay tuned!

Share this post:


My name is Jeff French. I'm a programmer, public speaker, technologist, husband, father and an all around geek. These are my musings on code, technology and life in general. Please enjoy. :)