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:
- Move your AssemblyInfo.cs file to AssemblyInfo.cs.in in all of your projects
- 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$”)]”
- 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.