As title says. Is there a way to get a value from TFS like a "Build Value" which I could implement in to visual studio Forms Application upon clicking "Check In" in "Team Explorer"?
Found something like this: https://archive.codeplex.com/?p=tfsversioning But looks too big of a project.
Assume you are using the vNext build system (TFS 2015 and later versison), then you can achieve that with CI (Continuous Integration) build.
Continuous Integration
, add
task Update AssemblyInfo
Build.BuildNumber
to get the build
number and set the build number as the file versionCopy below command and save as a PowerShell/cmd script, then add a PowerShell/Command task as the last task to run the script to check in the changes. See Checkin command.
tf Checkin $source_dir /comment:"Updated AssemblyInfo.cs version" /noprompt /force /bypass /override:"bypass checkin policies"
Thus the build definition will be triggered once you check in changes and the AssemblyInfo.cs
version will be updated automatically with the build number and the updated AssemblyInfo.cs
file will be checked in once the build completed.
Reference below threads: