0
votes

I am using Visual Studio Team Services. I have created a build definition using Hosted Build Controller and Hosted Build Agent. I have used a powershell script to assign version number automatically to assembly file or .exe file using TFS build number.

I have followed the following given links for this.

http://geeks.ms/blogs/jlsoria/archive/2014/02/17/get-your-binaries-versioned-automatically-in-less-than-5-minutes-with-tfs-build-2013.aspx

http://www.colinsalmcorner.com/post/matching-binary-version-to-build-number-version-in-tfs-2013-builds

But I am unable to assign version to my .exe application. All the time it takes version number from AssemblyInfo.cs file. My purpose is to assign value of TFS build number to my assembly file.

1
The scripts in question - at least the one in the second link - change the values in AssemblyInfo.cs before build. You should look at the scripts' output in the build log and understand what's not working there - inspect the parameters and the output.Jonathan

1 Answers

1
votes

Here are the steps:

1). Check in UpdateVersion.ps1 PowerShell file (content is from that blog) into TFS version control.

2). Set UpdateVersion.ps1 script to run via selecting it in pre-build script.

3). Set build number format to be: $(BuildDefinitionName)_1.0.1$(Rev:.r)

enter image description here