NuGet packages with dependencies

In my opinion, this is a huge feature missing. I can see so many uses for Octopus, but my output NuGet packages will always have dependencies - either that came with the template I’m using or that I’ve pushed to my own local feed.

I don’t even see it on the Trello board :frowning:

– Kori Francis (@djbyter)

Hi Kori,

Thanks for the feedback, I’ve added it to the Trello board ( It’s under “Ideas/suggestions for V2”, though I’ll consider moving it into the v1 column if others are interested in it.

I agree that it seems obvious for Octopus to support dependencies, but in actual usage scenarios I haven’t come across many situations where I would use it. In my scenarios, a package always has everything that needs to be deployed - dependencies tend to get bundled inside the bin directories of the packages.

Can you explain a little more about the contents of your packages and the contents of the dependent packages? What kinds of dependencies would you have?


Well, for instance - if I just take the default ASP.NET MVC 3 project, by default it uses six nuget packages (entity, 4 jquery related and modernizr). Right off the bat, I can’t then use Octopus to deploy it unless I remove those as nuget references and do it manually (so they’ll appear in the bin and get bundled as you said).

Now, that’s a basic sample that I’ve not been able to deploy. In my own projects, I have a local NuGet server that we pack and push our main libraries to that almost all the other projects rely on. Because it exists in more than one solution, it’s in a solution all on its own - so NuGet seemed to make it easier for us to coordinate (especially with the NuGetPowerTools) from project to project without worrying. Couldn’t this just be one of the tasks before deploy? “Install any missing nuget packages”, then specify the various sources (the main Microsoft feed for one, and I could specify the local feed (which in my case happens to be the same server)).

Thanks for listening :slight_smile: I’m dying to change my workplace to use OctopusDeploy exclusively to help fix our totally busted and time-waste of a deploy process, but I ran into this big hurdle.

Kori Francis
Lead Software Developer
Clinical Support Systems
P: (613) 766-9851
F: (613) 280-1520

Hi Kori,

I think this is a problem with how NuGet packaging tools work - when you package your website, they assume you’re trying to package a reusable piece of code - not something you intend to deploy.

It needs documenting, but my approach is to take my website, and perform a Publish using MSBuild to a temporary folder. I then copy a .NuSpec, and use NuGet.exe to create a package. This approach means that EF, jQuery and Modernizer are embedded inside the package instead of being listed as dependencies.

The issue with using them as standard NuGet dependencies is that NuGet makes assumptions about how the dependency should be installed. For example, some NuGet packages will expect to be run from within Visual Studio (this causes problems for people trying to perform a NuGet update on their build servers).

Similarly, for a website you want DLL’s like EF to be in your /bin folder. But NuGet dependencies mean only a reference is added to the .csproj, and you have to compile to copy them to /bin - so the deployed package would be missing essential files.

I hope that makes sense, and explains why the NuGet packages I create tend not to have dependencies - the way NuGet currently works usually means dependencies wouldn’t work anyway. I’ll try to do a better job of documenting this in future.


Another solution that I use for my project in TeamCity is to perform a Package using MSBuild instead of using Publish. The equivalent in Visual Studio is right-clicking on the web project and clicking on Build Deployment Package. It’s similar to doing a Publish, but the files go into YourWebProject\obj\Release\Package\PackageTmp (assuming you are in Release mode) so I don’t need to specify a temporary folder.

I’m including a couple screenshots on how I do this in TeamCity; the first is how I run the Package MSBuild step and the second is how I create the NuGet package from the web project.

Hope this helps,