Deployment version number mismatch

I’ve set up Octopus with Teamcity, which was amazingly simple.

I’ve got the build step set up in Teamcity, with a Relase number of %build.number%

Everything works fine, except that the version number actually deployed to IIS is one increment behind. For example, Teamcity just successfully built version 1.0.63, but the new folder added to C:\Octopus\Applications\Development{ProjectName} is called 1.0.62, and doesn’t contain the changes from the 1.0.63 release.

The next build and deploy will build version 1.0.64, but will deploy 1.0.63. It’s always one step behind.

Any ideas?



I had this problem too.

You probably noticed your first build failed and the next one worked. The reason for this is that the artifacts from the team city build are not available via the nuget package manager until the build is complete so if you are looking for the artifacts on a later step of the same build configuration, it will not be there (yet).

The solution for this is to create a second build configuration in TC with a snapshot dependency on your build BC, and have a build trigger that will fire a build once the first is complete.

I have configured as follows:

MyApp_BC: Build Trigger - Data Commit
Step 1: MSBuild MyApp with Octopack

MyApp_BC_Deploy: Build Trigger - Successful MyApp_BC run. Snapshot Dependencies - MyApp_BC.
Step 1:OctopusDeploy: Release

Worked like a charm, thanks Santi.

Is there any way to synchronise the build numbers between configurations? It seems like if they get out of sync between configurations, it would stop working.

Thanks. That worked for me too. This took an afternoon for me to work out with help. It must be a common issue. There should be something in the docs to cover this.


This issue has been closed due to inactivity. If you encounter the same or a similar issue and require help, please open a new discussion (if we asked for logs or extra details in this thread, consider including them in the new thread). If you are the creator of this thread and believe it should not be closed let us know via our support email.