Easily integrate check-in numbers to .NET assemblies

StuartProgramming Blog

Our team finds that it is very useful to have the Subversion repository numbers included in our build assembly versions.  To accomplish this (the easy way) you can use the subwcrev tool included in TortoiseSVN and:

  1. Move your AssemblyInfo.cs file to AssemblyInfo.cs.in in all of your projects
  2. Setup your assembly number as you like in your .in file with the macro objects used by subwcrev. We used “[assembly: AssemblyVersion(“1.2.0.$WCREV$”)]”
  3. Add the following pre-build instruction to all your projects:
subwcrev $(ProjectDir)\.. $(ProjectDir)Properties\AssemblyInfo.cs.in $(ProjectDir)Properties\AssemblyInfo.cs -f

When this command executes, the macros like $WCREV$ are automatically replaced in your .in file and a new .cs is generated.

Tags: 

StuartEasily integrate check-in numbers to .NET assemblies