发布版本与汇编(等)版本

发布于 2024-08-18 07:02:55 字数 627 浏览 2 评论 0原文

我在这里阅读了有关程序集、文件和程序集信息版本的线程。

我想知道发布版本适合哪里。结果...

string thisAppsVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();

...似乎是 AssemblyVersion。到目前为止,我一直在使用带有部署类的发布版本:

ApplicationDeployment deployment = ApplicationDeployment.CurrentDeployment;
Version thisAppsVersion = deployment.CurrentVersion;

...但是除非安装了应用程序,否则这是不可用的。我喜欢它可以选择自动增加修订版本。

有没有办法在不进行网络部署的情况下获取发布版本?它应该是应用程序版本的“公众形象”吗?

示例:UI 版本(从发布版本扭曲而来)

提前致谢!

格雷格

I've read threads here about the Assembly, File and Assembly Informational versions.

I'd like to know where the Publish version fits in. The result of...

string thisAppsVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();

...appears to be the AssemblyVersion. Up until now I've been using the publish version with the deployment class:

ApplicationDeployment deployment = ApplicationDeployment.CurrentDeployment;
Version thisAppsVersion = deployment.CurrentVersion;

...but this isn't available unless the app is installed. I like how it has the option to automatically increment the Revision.

Is there a way to get the publish version without being network deployed? Should it be the 'public face' of the app's version?

Example: UI Version (twisted from Publish Version)

Thanks in advance!

Gregg

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

情绪少女 2024-08-25 07:02:55

我认为不同的版本有不同的目的。

1)AssemblyVersion是供CLR加载和绑定程序集的。这对开发人员有用,但对最终用户没有用。

2) FileVersion 或AssemblyFileVersion 是Windows 显示为可执行文件版本的内容。它与 Win32 应用程序的版本相同。系统和安装程序使用此版本来确定哪个版本较新。

3) PublishVersion 用于对部署包进行版本控制。可以使用不同的发布版本两次发布相同的二进制文件。

4) 您向最终用户展示的版本是另一个版本。称之为产品版本或其他名称。它可能与上述任何一项不同,例如出于商业目的。如果您想使用某些 .NET 构建的内容,请参阅 AssemblyInformationalVersionAttribute -支持。

对于简单的情况,您可以使用 FileVersion 作为产品版本。但发布版本对我来说不是一个好主意。

I think the different versions serve different purpose.

1) AssemblyVersion is for CLR to load and bind assemblies. This is useful for developers but not end-users.

2) FileVersion or AssemblyFileVersion is what Windows displayed as the executable's file version. It is just the same Win32 application's version. And this version is used by the system and installers to determine which version is newer.

3) PublishVersion is used to version the deployment package. It is OK to have the same binaries published twice with different publish versions.

4) The version you show to your end-users is yet another version. Call it product version or something else. It may different from any of the above, for e.g. business purpose. See AssemblyInformationalVersionAttribute if you want to use some .NET built-in support.

For simple cases, you may use the FileVersion as the product version. But publish version is not a good idea to me.

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