Octopack, TeamCity & source control best practice

I’m currently testing Octopus and Teamcity together. I’ve been using Octopack and the TeamCity plugin to have the nupkg packages created by the MSBuild runner. When I add Octopack to a .NET project it creates a packages directory and a packages.config file. Initially, due to a source control ignore list, a number of files including NuGet.exe within the packages directory were not committed to source control and the MSBuild runner task failed in TeamCity. So in order to get the packages created I checked in the complete contents of the packages directory.

My question is regarding best practice in this scenario. Is it necessary to check everything in? What is the bare minimum required by the plugin in order to have the package created by the MSBuild runner?

Hi Peter,

Thanks for getting in touch. You would only need to commit the packages.config file in your project, and the change that OctoPack makes to your .csproj/.vbproj file.

Then, as long as your solution uses NuGet package restore (see the link below) OctoPack will be automatically be restored and will run during the build.

Hope this helps!


Hi Paul,

Thank you! I’m completely new to NuGet so that link was very helpful.
I’ve figured out that I can add a package install step to the TeamCity build plan in order to restore OctoPack.

Many thanks,