Change assembly version for multiple projects

白昼怎懂夜的黑 提交于 2021-02-05 20:55:36

问题


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.


回答1:


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.

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.




回答2:


One way to do it is to have a master build script that uses the AssemblyInfo Task to set the version number at build time(http://code.msdn.microsoft.com/AssemblyInfoTaskvers) and then define the versions numbers as properties in the msbuild script.




回答3:


I used find/replace function in VS. e.g. replacig assembly: AssemblyVersion("1.0. to assembly: AssemblyVersion("1.1. in all solution did what I neded :)



来源:https://stackoverflow.com/questions/980753/change-assembly-version-for-multiple-projects

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!