Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting AssemblyFileVersion with MSBuild-call?

We have a batch-based buildprocess and we are using MSBuild only for compiling our project-files from visual studio. We also have integrated wix into our build-process. To set the version of our software we specify in the main-build-script some environment variables, that we use during the build-process. My problem is, that i have to set the FileVersion of the Assembly (AssemblyFileVersion) in my assembly-informations. Is there a way to give the MSBuild-call a property with the version to set? Like this (this doesn't work):

%dotnetdir%msbuild.exe Viewer.csproj /property:Configuration=Release /property:Platform=AnyCPU /property:AssemblyFileVersion=%major%.%minor%.%build%

The resulting assembly should have the fileversion %major%.%minor%.%build%. It's pain for me to set the AssemblyFileVersion-setting in all projects. And a program which is doing this is against my philosphy (i don't want to change my source with automated processes). The version should be set through the build-script. It is not necessary that the AssemblyFileVersion is set in the AssemblyInfo.cs

Or is there a possibility with MSBuild to specify a xml-configuration-file which describes the assembly-informations?

Would be great if there are any advices.

greetings, thanks, Martin

like image 719
martin Avatar asked Dec 07 '09 11:12

martin


1 Answers

The Version and AssemblyInfo tasks from the MSBuild Community Tasks project may help.

like image 88
devstuff Avatar answered Sep 28 '22 05:09

devstuff