Getting the build version no.

Hi,

I am programming my own build tool in .NET and want to get the current TeamCity build number. In MSBuld I can use $(BUILD_NUMBER). Is there a way to get this string and other TeamCity properties in C#?

Best regards,
Steffen

1 comment
Comment actions Permalink

Ok sorry. Stupid me.

According to http://www.jetbrains.net/confluence/display/TCD4/Using+Properties#UsingProperties-UsingPropertiesinthebuild the properties are available as Environment variables.

===> System.Environment.GetEnvironmentVariable("BUILD_NUMBER") will do the trick.

0

Please sign in to leave a comment.