Set up Octopack for multiple build configurations

Here’s my scenario:

I’m using Visual Studio 2013 and TFS 2013 Update 4. I have a solution with multiple projects. Only one of the projects is configured for Octopack. All of this works fine except for one thing. The solution has multiple build configurations and so the project is getting packed and published multiple times. This of course causes an error 400 because the package already exists in the feed.

I was wondering if there is a good way for handling a scenario such as this? Perhaps I could tell the build process to drop all NuGet packages into a specific folder and publish the contents when the build completes? Just trying to find a good solution.

Hi there

Thanks for getting in touch.

Your best option for this would be to run a step after all your builds which pushes the correct package to your Octopus server. You can use NuGet.exe to do this with the address of your Octopus server plus API key (which is what Octopack does when you invoke the publish option).

It’s a little bit messier to have to go find the right artifact and write the script but it will let the rest of your build process work the same way.

Hope that helps

Damian