I'm using the MSBuild Community Task library to get the current SVN version an set that in my AssemblyInfo files to get the revision in the final compiled dll.
As you know SVN version can then be like "28" or "28M" - if there are modifications. If i do a MSBuild message and output the Revision property I see I get a 28M after modification but when updating the AsseblyInfo I keep getting only 28 in the version number ..?
I'd like to have the 28M in the version number to indicate the dll is built using a non-check in modification. How can I get that working?
<Target Name="Compile">
<SvnVersion LocalPath="$(MSBuildProjectDirectory)" ToolPath="$(SvnTool)">
<Output TaskParameter="Revision" PropertyName="Revision" />
</SvnVersion>
<ItemGroup>
<AssemblyInfoFiles Include="x.a\Properties\AssemblyInfo.cs" />
<AssemblyInfoFiles Include="x.b\Properties\AssemblyInfo.cs" />
</ItemGroup>
<FileUpdate Files="@(AssemblyInfoFiles)"
Regex="(\d+)\.(\d+)\.(\d+)\.(\d+)"
ReplacementText="$(MajorVersion).$(MinorVersion).$(Revision).0" />
<MSBuild Projects="$(MSBuildProjectDirectory)\ConfigExplorer.sln" Targets="Rebuild" Properties="Configuration=$(BuildType);" />
int
in Version class:public int Revision { get; }
. But you can use for example AssemblyInformationalVersionAttribute attribute instead to store any text you like. – Igor Korkhov