I stumbled upon a useful feature of TeamCity today. The ability to set TeamCity variables from your build. This can be useful for instance if you create a version number in your build which you wish to use as the build number or label for VCS inside TeamCity.
All you need to do is output a message in a particular format. Here is an example of setting the build number in MSBUILD to the value of a property.
<Message Text="##teamcity[buildNumber '$(AssemblyVersionString)']" />
After this has run in your build, the value of the TeamCity variable %system.build.number% will now be assigned the value of AssemblyVersionString.