There are multiple c# class library (DotNet Core 2.1) projects and User Interface (WPF project) in my solution.
Let say a class library project properties have Assembly version 2019.1.15341.0:
Also, the same Assembly version is assigned to the user interface (WPF application):
[assembly: AssemblyVersion("2019.1.15341.0")]
[assembly: AssemblyFileVersion("2019.1.15341.0")]
In TeamCity, I have configured AssemblyInfo Patcher:
I build the complete solution using TeamCity and the builds were successful:
Now let's see the property of artifacts produced after Building the complete solution:
1. Project 1 (Class library, DLL properties):
2. UserInterface (WPF project):
I see that the UserInterface.exe's Version
has been changed by TeamCity according to it's build counter
and build vcs number
, but Why the DLL's version
is not changed? Am I missing any steps? or anything else?
Any information I am missing please inform.
The properties of EXEs seems fine as expected. The main concern is on the DLLs: It's property is not getting changed.
As mentioned it is a .Net Core
project, so it may not be having an AssemblyInfo.cs
where Assembly properties are defined.
So go to Build Features in TeamCity, and add a Build Feature.
<Version>\S*<\/Version>
or use template regex: (<(Version)\s*>).*(<\/\s*\2\s*>)
I have used Replace With: <Version>%MAJOR%.%MINOR%.%build.counter%.%build.vcs.number%</Version>
so that <version>
and </version>
tags don't get deleted as per my regex. It all depends on your regex what you need to replace.
Similarly, I have added other required parameters:
Pros: After building the project I can see the expected results in properties.
Cons: Searches and Replaces the files multiple times and not once (the number of Build features, the same number of time it will be executed, and the same number of time it will be reverted!)
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