Reputation: 143
I'm trying to get TFS to pass the build number to MSBuild but it looks like the environmental variables are not being parsed and I'm getting the following error:
'$(TF_BUILD_BUILDNUMBER)' is not a valid version string.
The argument I'm using is:
/p:OctoPackPackageVersion=$(TF_BUILD_BUILDNUMBER)
I've also tried using the build id but that doesn't get parsed either. If I type the same version number into the argument then the build completes successfully.
I'm using Visual Studio 2013 and TFS on Visual Studio Online. Please let me know if there any settings I can try change to resolve this.
Thanks very much
Upvotes: 2
Views: 731
Reputation: 1
Old thread I know, but for anyone who has stumbled across this running TFS "15" RC2 or later, using tasks in vNext, the property I found that worked is $(BUILD_BUILDNUMBER) and can be utilised in the .proj files. InstallShield was causing me issues when trying to pass the build number into the ProductVersion...
Adding this line fixed my problem..
<InstallShieldProductVersion>$(BUILD_BUILDNUMBER)</InstallShieldProductVersion>
Upvotes: 0
Reputation: 143
After many hours I've solved this by changing the build process template to TfvcTemplate.12.xaml.
Upvotes: 0
Reputation: 59035
That would be correct for the XAML build system. If you're using the newer build system instead, it would be $(Build.BuildNumber)
.
Upvotes: 1