How to unify the project version number under the solution

Source: Internet
Author: User

Projects under the solution often need to unify the generated assembly version numbers in the simplest way, of course, by opening the AssemblyInfo.cs file modifications under each project, or by using the project property modifications. Recently, there is a much simpler way to find out, and to introduce it carefully below.

Step 1, create a SolutionInfo.cs file, and put it under the solution. The content is similar to the following:

Using System.Reflection;
Using System.Runtime.CompilerServices;
Using System.Runtime.InteropServices;
   
[Assembly:assemblycompany ("Projky")]
[Assembly:assemblyproduct ("Projky architecture")]
[Assembly:assemblycopyright ("Copyright? Projky 2013 ")]
   
//Here Modify the version number you want to unify, note that the file version number is consistent with the assembly version number
[Assembly:assemblyversion (" 2.5.0.6 ")]
[assembly: Assemblyfileversion ("2.5.0.6")]

Step 2, add SolutionInfo.cs to the solution, and note that it is not under any one project. Directly in Solution Explorer, select the solution, right-click, add existing items, and add SolutionInfo.cs.

Step 3, modify the AssemblyInfo.cs under each item, delete the feature information such as the version number, and in my example, delete the following lines of code:

[Assembly:assemblycompany ("Projky")]
[Assembly:assemblyproduct ("Projky architecture")]
[Assembly:assemblycopyright ("Copyright? Projky 2013 ")]
[Assembly:assemblyversion (" 1.0.0.0 ")] [
assembly:assemblyfileversion (" 1.0.0.0 ")]

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.