Using Nuget pack in Teamcity

Playing around with a few different variations of creating artifacts, and one I’m trying is using the default NuGet Pack build runner in TeamCity, however I’m seeing some weird things.

I just created a sample MVC project. I have set the Speficiation files to the csproj of the application, and an artifact is being generated. First weird thing, is when I view the artifact contents, it’s missing files, even though they are included in my VS project and set to content. For example, there is a Content\Site.css which is in the nuget package, but Content\themes\jquery-ui.css etc aren’t. Similarly, the web.config isn’t, but it is renamed to web.config.transform

Secondly, when I then setup a deploy in Octopus, it’s then deploying the files in the same way as they are packaged. (I understand OctoPack does this how the application should be eventually deployed, but documentation says Nuget Pack is supported.)

Just trying to figure this one out, as I have a requirement for this for some projects, and using OctoPack for others.

Hi Mick,

If you use NuGet pack, you’ll need to crete a custom .NUSPEC file that describes the contents of the package.

Hope this helps,

I know we’ve moved into NuGet territory, in TeamCity, you can set the csproj file, this doesn’t then automatically generate this, you still need to define a custom .nuspec file?

What is the NuGet pack that you are referring to? A NuGet application, a setting in TeamCity, or something within Octopus?




NuGet.exe is a command line tool for creating NuGet packages that you can download from:

You can use NuGet.exe pack to create packages manually.

TeamCity also has a build in NuGet: Pack runner that is the equivalent.