如何让 Visual Studio 安装项目覆盖所有 DLL - 或者如何让 Visual Studio 在每次构建时增加版本号?

发布于 2024-12-25 02:54:33 字数 500 浏览 3 评论 0原文

我正在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

遗弃M 2025-01-01 02:54:33

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)?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文