Trouble deploying WebJob with Azure Web site

I have added a nuspec file to my Web project and added a files element to try and include the executable for the webjob in the Web Project so the website and webjob can be deployed together to Azure. I’m following this article - so I’ve also added OctoPackEnforceAddingFiles to the web project’s csproj file.

The Octopus build fails as it can’t find those files I refer to.

[CreateOctoPackPackage] error OCTONUGET: Could not find a part of the path ‘D:\BuildAgent03\work\8618d862620640ee\Source\CrisisManagerWorker\bin\release’

I’m having trouble working out where to go from here. I have checked D:\BuildAgent03\work but it is empty. I’ve attached my nuspec file. Thanks!

CrisisManager.Web.nuspec (478 Bytes)

build log attached

CrisisManager_1._Feature_Branches_1.0.0.255.log (506 KB)

Hi Matthew,
My immediate suspicion is that your WebJob project isn’t actually getting built before OctoPack runs as part of your WebApp and tries to package it all up together. Octopack to be able to access the WebJob source files TeamCity needs to have built that project before the WebApp. This sounds more like a project reference configuration issue. Could you make sure that either the WebApp references the WebJob as a dependency, forcing it to be built first, or create a separate project that references the two of them.
If in doubt the TeamCity logs should indicate if the WebJob project has successfully built first.
Give that a go and let me know if you get stuck again.

Hi Matthew,
Checking your logs it looks like my suspicions are probably correct since only a few lines after the failed package, that the CrisisManagerWorker project actually starts to build.
It needs to be built before it can be packaged up :slight_smile:

Thanks Robert! That worked :slight_smile:

Matthew Mortensen
IS Development Manager

T: 61 7 33163726 | V: 413726 | E:
145 Ann St Brisbane QLD 4000 Australia |

Please consider the environment before printing this email