How can I set the displayed Version Number?

I would like a build number in the form "MAJOR.MINOR_alpha_build_BUILDNUMBER"

so I use:


As the Build number format.

I like to read the major and minor number from I expectet, that the variables in the Build number format are replaced by the values from the


Do I have to use something like

##teamcity[buildNumber '<new build number>']
in my build script or is it possible with an additional system.* parameter?

The expected value in my example is 1.02_alpha_build_265



To set build number from build script you need to send service message to server using

##teamcity[buildNumber '<new build number>'].

Also you can define build number by triggering build with parameters. It can by triggered from UI using "Run custom build" or from by triggering build from script, see and


I want to read the build number only from the file. If it does not have to be I want the build number does not need to put on a build scrip.

I still do not quite understand why the values ​​from the file not read at the beginning and then the actual build process begins.

0 file is read when build have already started. So the values from this file cannot be used to configure build number (without service message).



Thanks for the information. I was a bit confused because I have not read accurately due to the following documentation:

When TeamCity starts a build process, the following precedence of the build parameters is used (those on top have higher priority):

* parameters from the file.
* pre-defined parameters.
* parameters defined in the Run Custom Build dialog.
* ...

I thought a "build process" is the actual build, not the start the "build scripts".


Please sign in to leave a comment.