如何让 Visual Studio 安装项目覆盖所有 DLL - 或者如何让 Visual Studio 在每次构建时增加版本号?
我正在使用 VS2010 安装程序项目来部署我的应用程序。我可以将RemovePreviousVersions 属性设置为True,安装程序将覆盖每个版本号已更改的程序集。问题是,我们有大约 30 个项目,因此几乎不可能手动增加所有版本。如果我在 AssemblyInfo.cs VS 中设置
[ assembly: AssemblyVersion("1.0.*")]
,
则正确生成一个数字,如果我检查
System.Reflection.Assembly.GetExecutingAssembly( ).GetName().Version
但是,安装程序没有反映这一点...
所以我想做的是强制安装程序覆盖所有程序集,无论版本号是什么,或者我想要强制安装程序预先卸载以前的版本,或者我希望 Visual Studio 在每次构建时增加版本号,以便安装项目注意到它。
一如既往,在我看来,这似乎是世界上最简单的事情,但我不知道如何做到。
i am using the VS2010 Installer project to deploy my application. I can set the RemovePreviousVersions property to True and the installer will override every assembly with changed Version number. Problem is, we have around 30 projects, so it is practically impossible to increase all versions by hand. If i set
[assembly: AssemblyVersion("1.0.*")]
in the AssemblyInfo.cs VS properly generates the number which i can see if i check
System.Reflection.Assembly.GetExecutingAssembly().GetName().Version
However, the installer does not reflect this...
So what i want to do is to either force the installer to override ALL assemblies no matter what version number, or i want to force the installer to uninstall the previous version beforehand, or i want visual studio to increase the version number with every build so that the setup project notices it.
As allways it seems to me like the simplest thing in the world but i can't figure how.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Visual Studio 有几个插件可以自动增加构建号,例如。这个:
http://autobuildversion.codeplex.com/
另外看看这篇文章:如何拥有自动递增版本号(Visual Studio)?
There are several addins to visual studio which can increment build number automatically, eg. this:
http://autobuildversion.codeplex.com/
Also take a look at this article : How to have an auto incrementing version number (Visual Studio)?