From scavaging the around the web, I pieced together the follow steps to setup TortiseSVN’s revision number (aka subwcrev) and time stamp as part of the assembly version.
- Copy the existing Properties\AssemblyInfo.cs file to a file named AssemblyInfo.template
- Edit the file, changing to the following:
C#12[assembly: AssemblyVersion("1.0.0.$WCREV$")][assembly: AssemblyFileVersion("1.0.0.$WCREV$")]
- Edit the Project properties, adding the following Pre-Build events:
Shell12cd "$(ProjectDir)"SubWCRev . "Properties\AssemblyInfo.template" "Properties\AssemblyInfo.cs"
- Build your code, and display the assembly version info with the following snippet:
C#1this.Text += "- " + Assembly.GetExecutingAssembly().GetName().Version.ToString();