更改程序集版本的多个项目多个、版本、程序、项目

2023-09-03 05:59:20 作者:╭兜兜里有糖糖ァ

我怎样才能更改文件的AssemblyInfo.cs多个项目的程序集版本。我们大约有75项目在我们的解决方案,我们需要的几乎每个星期都来更改版本。什么是做到这一点的最快方式。

How can I change the assembly version in the file AssemblyInfo.cs for multiple projects. We have around 75 project in our solution and we need to change the version almost every week. What is the fastest way to do this.

推荐答案

我通常创建一个文件,该文件中包含的称为AssemblyVersionInfo.cs在所有项目中的链接的。我把这个文件包含版本属性,从常规的AssemblyInfo.cs文件中删除相同的属性。然后,你可以只在一个文件中更新的版本号,并让所有的项目共享同一号码。

I usually create a file called AssemblyVersionInfo.cs that is included as a link in all projects. I make this file contain the version attributes, and remove the same attributes from the regular AssemblyInfo.cs files. Then you can update version numbers in one file only, and make all the projects share the same number.

要添加的文件为纽带;右键单击Solution Explorer中的项目,选择添加 - >现有的项目...。浏览到该文件,然后单击添加按钮的右边的小箭头,并在下拉菜单中选择添加链接。

To add the file as a link; right click the project in the solution explorer, select "Add" -> "Existing item...". Browse to the file, and then click the little arrow in the right edge of the add button, and select "Add As Link" in the dropdown menu.