C#dll version number default generation rule

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.