How to make assembly version available to TeamCity

I want to include the assembly version number in the filename of athe artifact that my TeamCity build builds.

I have made a buildstep that names the artifact

MOVE /Y "installerName\bin\Debug\Program Install.msi" "installerName\bin\Debug\Program (%env.TEAMCITY_BUILDCONF_NAME% build %build.counter%).msi"


As you can see i include the build name and build count in the artifact name, but i also want to include the assembly version number in the filename.

How do i achieve this?

4 comments
Comment actions Permalink

Hi Jan,

Do you use AssemblyInfo Patcher build feature in TeamCity? If yes, then you can specify Assembly version format using some parameter and use the same parameter in the artifact name.
If it is not what you want, then please clarify your question.

0
Comment actions Permalink

Hi Alina. Thanks for taking the time to responde.

No we do not use Assemblypatcher in our solution.

I not sure this is a clarification of my question but here goes:

First of all. We are using version 8.1 of TeamCity.

We have 4 buildsteps in our build.

The two first steps selects different config files.

The third step builds the solution and produces an artifact.

In the final step (this is where i need the help) we rename the artifact. I want to include the assembly version in the name of the artifact,

but i do not know how to read the assembly version of the solution in TeamCity, and that is why i've asked the question.

0
Comment actions Permalink

Jan,

Thank you for clarification. TeamCity doesn't get assembly version automatically. You can get this version using the build script from AssemblyInfo.cs file.
However I would recommend you to use AssemblyInfo Patcher build feature.

0
Comment actions Permalink

@Alina Mishina. "You can get this version using the build script from AssemblyInfo.cs file." 

Can you explain please more on how to do this?

 

Thanks

0

Please sign in to leave a comment.