Insert SVNRevision and Build number in your AssemblyInfo
MSBuild Community Task, you can easily automatically generate smart version numbers, you have to:
**AssemblyInfo Update when project build in release mode
<!-- Import of the MSBuildCommunityTask targets -->
<Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets" />
<!-- to AssemblyInfo to include svn revision number -->
<Target Name="BeforeBuild" Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "><!-- <Version VersionFile="Version.txt" BuildType="Increment" RevisionType="None">
-->
<Version Condition=" '$(SkipIncrementAssemblyVersion)' != 'true' " VersionFile="Version.txt" BuildType="None" RevisionType="None">
<Output TaskParameter="Major" PropertyName="Major" />
<Output TaskParameter="Minor" PropertyName="Minor" />
<Output TaskParameter="Build" PropertyName="Build" />
</Version>
<SvnVersion LocalPath="$(MSBuildProjectDirectory)" ToolPath="$(ProgramFiles)\VisualSVN\Bin">
<Output TaskParameter="Revision" PropertyName="Revision" />
</SvnVersion>
<Time Format="MM/dd/yyyy hh:mm:ss tt">
<Output TaskParameter="FormattedTime" PropertyName="buildDateTime" />
</Time>
<FileUpdate Files="Properties\AssemblyInfo.cs" Regex="SVN Revision: r(\d+)" ReplacementText="SVN Revision: r$(Revision)" />
<FileUpdate Files="Properties\AssemblyInfo.cs" Regex="Build On: (\d+)\/(\d+)\/(\d+) (\d+)\:(\d+)\:(\d+) ((A|P)M)" ReplacementText="Build On: $(buildDateTime)" />
<FileUpdate Files="Properties\AssemblyInfo.cs" Regex="Build Machine: ([A-Za-z0-9\-]+)" ReplacementText="Build Machine: $(COMPUTERNAME)" />
<FileUpdate Files="Properties\AssemblyInfo.cs" Regex="AssemblyVersion\('(\d+)\.(\d+)\.(\d+)\.(\d+)'\)" ReplacementText="AssemblyVersion('$(Major).$(Minor).$(Build).$(Revision)')" />
<FileUpdate Files="Properties\AssemblyInfo.cs" Regex="AssemblyFileVersion\('(\d+)\.(\d+)\.(\d+)\.(\d+)'\)" ReplacementText="AssemblyFileVersion('$(Major).$(Minor).$(Build).$(Revision)')" />
<FileUpdate Files="Properties\AssemblyInfo.cs" Regex="AssemblyInformationalVersion\('(\d+)'\)" ReplacementText="AssemblyInformationalVersion('$(Revision)')" />
</Target>
You should only have a “</Project>” field left