Hi Everyone
I have followed a tutorial regarding the usage of the Version Task to increment the assembly version for multiple projects in a solution.
Is the suggested method the following:
For each project, modify each project to use Version Task to create a separate versioninfo.cs file (or similar) int the "BeforeBuild"
This is what I have so far
<!-- New increment version step-->
<Target Name="IncrementVersion" Condition="'$(SkipIncrementAssemblyVersion)' != 'true'">
<Message Importance="high" Text="Incrementing build number..." />
<Version VersionFile="$(SolutionDir)\.build\Version.txt" StartDate="01/31/2015" RevisionType="Increment">
<Output TaskParameter="Major" PropertyName="Major" />
<Output TaskParameter="Minor" PropertyName="Minor" />
<Output TaskParameter="Build" PropertyName="Build" />
<Output TaskParameter="Revision" PropertyName="Revision" />
</Version>
<PropertyGroup>
<BuildNumber>$(Major).$(Minor).$(Build).$(Revision)</BuildNumber>
</PropertyGroup>
<Message Importance="high" Text="Incrementing build number to $(BuildNumber)" />
<AssemblyInfo CodeLanguage="CS" OutputFile="Properties\VersionInfo.cs" AssemblyVersion="$(Major).$(Minor).$(Build).$(Revision)" AssemblyFileVersion="$(Major).$(Minor).$(Build).$(Revision)" />
</Target>
Then to run it I call "MSBuild [project name etc] /t:IncrementVersion
Is there a more elegant way of doing this? The other problem is that the new version number is only visible in the Properties window of the DLL when I build the project through Visual Studio. Is this supposed to happen?