Getting the build version no.


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,

1 comment
Comment actions Permalink

Ok sorry. Stupid me.

According to the properties are available as Environment variables.

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


Please sign in to leave a comment.