OctoPack NuGet fails to find CSS in project

This is my first swag at using Octopus deployment. We have a TeamCity project configured to build our solution. I included OctoPack in my MVC webproject and set up the parameters as described here: http://octopusdeploy.com/automated-deployments/teamcity-deployment. Everything seemed to be going okay until the compilation step on the build server when it failed with the following exception:

error OCTONUGET: File not found: ‘C:\TeamCity<PathToOurSite>\Content\site.css’.

This error makes sense, as we don’t actually have that file. It’s generated using LESS in VS. It’s something that has never come up for the team, as we currently package using VS Publish to disk, then check the published site into source control and pull it. I’m trying to POC use of Octopus and this is a bit of a showstopper for me… Is there something special needed to handle LESS preprocessing for NuGet using OctoPack?

Thanks for any help you can afford us.

Hi - OctoPack runs as an “AfterBuild” step which is a bit early for some post-processors; is it possible to have the LESS generation step run earlier in the build? You might be able to achieve this by reordering elements in the .csproj file.

The recommended workaround in these kinds of situations is usually to create a regular NUSPEC file for your project build outputs (<file> elements can use a wildcard src= attribute) and then pack the project using NuGet.exe pack.

Hope this helps, let me know if it doesn’t get you unblocked.


Yeah, clearly there’s something off about my understanding about how all this works. The LESS generation happens whenever the .less file is saved. The files were included in the csproj, but ignored in the .hgignore for some reason. Once I changed that, the files were found and the nuget package built.

Thanks for the help!