I am currently setting the assembly version on all my C# assemblies using the TeamCity AssemblyInfo Patcher. The version scheme I chose is 'Major.Minor.%build.number%.0'. This works fine when I define Major and Minor numbers in TeamCity, but ideally I would like to have them already defined in my AssemblyInfo.cs file and have TeamCity only set the value for the build number. Is this possible?
One solution I see is to forsake using AssemblyInfo Patcher and use my own version update script, but that seems heavy-handed.
You can define a parameters file which you check into version control, and then update the scheme to %system.major_version%.%system.minor_version%.%build_number%.0
. Then you can keep using AssemblyInfo Patcher, but patch everything based on the values in the props file.
Just put the following in a file named teamcity.default.properties
in your project root:
system.major_version=3
system.minor_version=15
This will result in the build number 3.15.1234.0
for build #1234.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With