As stated in the file itself:
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
//[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
By changing this the following way:
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.*")]
//[assembly: AssemblyVersion("1.0.0.0")]
//[assembly: AssemblyFileVersion("1.0.0.0")]
You'll get an auto set of the last two sections (Build Number
and Revision
). And this auto-increment works as follows:
Build Number
: Days since 1.1.2000
Revision
: Seconds since midnight divided by two
And last but not least if you use Subversion for SourceControl you can create a template file (copy of the same file with other name) where you replace on a desired place something like this:
[assembly: AssemblyVersion("1.0.$WCREV$.0")]
And within your pre-built event of your project you'll enter something like this:
SubWCRev "$(ProjectDir)" "$(ProjectDir)PropertiesAssemblyInfo.template.cs" "$(ProjectDir)PropertiesAssemblyInfo.cs"
To get your current Subversion revision number into the version information of your application.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…