更新解决方案中所有程序集的版本号 [英] Updating the version number of all assemblies in a solution

查看:136
本文介绍了更新解决方案中所有程序集的版本号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Visual Studio中有一个相当大的解决方案.是否可以通过一种方法一次更新解决方案中所有程序集的主要/次要版本号?

I've got a rather large solution in Visual Studio. Is there a way to update the Major / Minor version numbers for all the assemblies in the solution in one go?

推荐答案

您可以在解决方案中的所有项目之间共享AssemblyInfo.cs文件.该共享文件应包含版本号.要共享它,必须在VS中使用添加现有文件",然后在文件对话框中选择添加为链接".每个项目都有其专用的和共享的AssemblyInfo.cs.私有的仍然包含非版本属性.

You can share an AssemblyInfo.cs file between all projects in the solution. This shared file should contain the version numbers. To share it, you must use Add Existing File in VS and select Add as Link in the file dialog. Every project has its private and the shared AssemblyInfo.cs. The private one still contains the non-Version attributes.

我有一个TeamCity设置,在其中使用实际的构建版本在每个TeamCity构建中生成共享文件,并且运行良好.

I've got a TeamCity setup, where I'm generating the shared file in each TeamCity build using the actual build version and it works beautifully.

这篇关于更新解决方案中所有程序集的版本号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆