Mix existing and AssemblyInfo patcher generated version info in TeamCity builds

This is a cross-post from Stack Overflow.



I've enabled a "Build Feature" called "AssemblyInfo patcher" to tweak  the version of DLLs generated by my TeamCity builds. I've remixed info  from this other question and came up with this

Assembly version format
setting:
1.0.%build.vcs.number%.%system.build.number%


Now the final thing I would like to achieve is have the Major (

1
) and Minor (
0
) come from the original files, instead of hard coding them into TeamCity.

How can I do that?

I've guessed / tried:
{1}.{0}.%build.vcs.number%.%system.build.number%


But this gives an error. I've tried:

%build.vcs.number%.%system.build.number%


But this generates the

vcs.number
and
build.number
as major/minor instead of build and revision number, so e.g.
1234.21.0.0
.

I've read the AssemblyInfo patcher documentation but it doesn't explain much at all.

I've skimmed the available variables (with the icon to the right of the input field) but found no relevant variables.

How can I set up the "AssemblyInfo patcher" so that:
  • Major and Minor are kept as they are in the source files;
  • Revision is the VCS revision number;
  • Build is the TeamCity build number.


If it's possible at all?

3 comments

Hi Jeroen,

Please find my answer on stackoverflow.

0

Thx for the suggestion. I was aware of that  Build Feature, but consider it to be a hack / workaround in this case,  since the "AssemblyInfo patcher" seems like the appropriate thing to use.

I was hoping / looking for a way to get the Patcher feature to work in the way I want it to. If I can't I may resort to  your suggestion, or pehaps just live with the hard coded major/minor.

0

Actually File Content Replacer is a new feature that includes and extends the capabilities provided by AssemblyInfo Patcher. We do not remove AssemblyInfo Patcher because of backward compatibility.
So it's recommended to use File Content Replacer.

0

Please sign in to leave a comment.