Using OctoPack with class library only solution

I have a .net solution with roughly a dozen C# class libraries in it. The solution does not contain a website, windows service or any other kind of project. Currently on my TC build server I’m compiling my solution file with /p:OutputPath="\fileserver\share" to output the contents of all the class library projects to a single directory on a network share. I now want to use package up the content from all the projects into a single nuget package and publish it for consumption by Octopus. The problem I’m having is that I have no single project in my solution that is a consumer of all the others, and so it isn’t obvious which one I should install the Octopack nuget package on. I’m currently installing Octopack on a test project in the solution and manually constructing a nuspec file. However I still need to cherry pick other pieces of output such as config files from many of the other projects, and it all feels very hacky.

I’m wondering if there is an easier way to capture all the output from all the projects without having to ditch the ease of use of Octopack and revert to manually constructing a nuget package?


OctoPack works by:

  1. Looking at the project and figuring out what files to include (e.g., for an ASP.NET project), and then:
  2. Generating a NuSpec file and calling NuGet.exe pack

In this case I don’t think OctoPack can do much to figure out what files you need to include, since as you say, it isn’t clear which project you would use.

Creating your own NuSpec file and calling NuGet.exe pack manually is going to be your best bet. Note that you can use wildcards in NuSpec files, so once you’ve set it up you shouldn’t have to keep coming back to it.

Hope that helps,


Hi Paul,

I got this working by manually calling NuGet.exe pack on a hand crafted nuspec file.

many thanks.