4

How do I get system property from teamcity in msbuild file?

teamcity version:6.0

yang-qu
  • 2,144
  • 4
  • 20
  • 26
  • Ben Hall has a good [post with pics](http://blog.benhall.me.uk/2008/06/team-city-update-assemblyinfo-with.html) that helped me.... – Ruben Bartelink Apr 27 '11 at 13:52

3 Answers3

4

Try removing system_ part from property's name.

The documentation says

  • Don't forget to leave the "system." part out of the system
    properties.
  • When using MSBuild, replace "." with "_" when you reference property names.

(However this is version 6.5 documentation, maybe it woun't work in your case but you can try it anyway)

1

Just use $(system_property_name) in your MSBuild file.

Aleš Roubíček
  • 5,198
  • 27
  • 29
0
<PropertyGroup>
    <Version>$(BUILD_NUMBER)</Version>
</PropertyGroup>
Ashfaq Hussain
  • 331
  • 2
  • 11
  • Yes, that works. The trouble here is that I also need to get dependent build number. What I did is to create a system property and assign dependent build number to it, then I can use this system property in build file. e.g. Name: system.dep.build.number, Value: %dep.bt23.build.number%. Now, in msbuild file, you can use $(dep_build_number) to get dependent build number. – yang-qu Dec 22 '11 at 02:51