Original: C#dll version number default generation rule
1. Version number auto-generation method
Simply put the AssemblyInfo.cs file in the [assembly:
AssemblyVersion ("1.0.0.0")] Change to [assembly:
AssemblyVersion ("1.0.*")], in addition to the [assembly:
Assemblyfileversion ("1.0.0.0")] comments are masked out. The resulting assembly is the automatic version number.
2. According to the version number in this format, the location of the internal revision number (third field) appears as the number of days from January 1, 2000 to the date of compilation, and the internal Revision number (fourth field) is the number of seconds/2 from 0 points to the current time of the day.
DateTime D1 = datetime.parse ("2000-01-01");
DateTime D2 = Datetime.today;
TimeSpan D3 = D2. Subtract (D1);
DateTime d4 = Datetime.today;
DateTime d5 = DateTime.Now;
TimeSpan d6 = d5-d4;
Console.WriteLine (D3. Totaldays);
Console.WriteLine (Math.floor (D6. TOTALSECONDS/2));
Console.WriteLine (System.Reflection.Assembly.GetExecutingAssembly (). GetName (). Version.tostring ());
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
C#dll version number default generation rule