How to add files at build time


During the build in TeamCity, some file are generated that must be deployed also. By definition these files cannot be part of the Visual Studio project. What is the recommended approach of getting such files into the Octopus Nuget artifact?



Thanks for reaching out. This doc shows how to add files during build time:

Its aimed specifically for Post Build event files, but once you read it you’ll see it can also apply for what you need.

Hope that helps,

Yes I see - so what I’d do is to create the NuSpec file…
Is it required that the Nuspec is in the project? Or should it just reside next to the csproj file when Octopack is called?

Doc says It is important to note here that for OctoPack to find and use a NuSpec file, it must be named the same as your project as seen above.

I believe it should be enough with having the Nuspec next to the csproj file and named the same as your project (see screenshot)

I could be wrong though(I always add it to my projects). If it doesn’t work by just putting it next to the csproj and having the right name, add it to your project as well.


Work beautifully, thanks Dalmiro.