AssemblyVersionAttribute中的大修订

AssemblyVersionAttribute中的大修订

本文介绍了.NET:AssemblyVersionAttribute中的大修订号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的惯例是将构建版本版本化为[major].[minor].[micro].[revision],例如2.1.2.33546.

We have the convention of versioning our builds as [major].[minor].[micro].[revision], e.g. 2.1.2.33546.

我们的构建脚本会自动更新包含

Our build-script automatically updates an AssemblyInfo.cs file containing

[assembly: AssemblyVersion("x.y.z.w")]

以便将版本号嵌入到程序集中.

in order to embed the version-number in the assembly.

但是我们的Subversion存储库刚刚达到版本#65535,这破坏了我们的版本.

But our Subversion-repository just reached revision #65535, which broke our build.

事实证明,版本号中的每个数字的最大值为65534(可能由于Windows限制).

It turns out that each number in the version-number has a maximum value of 65534 (probably due to a Windows-restriction).

您遇到了这个问题吗?有什么好的解决方案/解决方法吗?

Have you encountered this problem? Any good solutions/workarounds?

我们喜欢嵌入版本号的方案,显然我们不能只重置Subversion-server:-)

We like the scheme of embedding the revision-number and we obviously can't just reset our Subversion-server :-)

推荐答案

更多背景信息:

为什么内部版本号限制为65535?

由于这不太可能更改,因此您可以选择以下选项:

As this is unlikely to get changed, your options are:

  • 采用Revision Modulo 65535,这意味着您已回到1
  • 使用版本号中的微字段"将修订版除以1000,以拆分版本号.这意味着您的版本可能是1.0.65.535
  • 请勿将SVN修订版本存储在AssemblyVersion中,而应存储在 AssemblyInformationalVersion 中.这样,您的应用程序仍可以出于显示目的访问它,尽管您不再可以使用Windows资源管理器来快速检查SVN修订版.
  • 不要将SVN修订版本存储在AssemblyVersion中,而是存储在AssemblyProduct或AssemblyDescription字段中.同样,您的应用程序仍然可以通过这种方式访问​​它,但是资源管理器现在也会在属性表中显示它.
  • Take the Revision Modulo 65535, which means you are back to 1
  • Use the Micro-Field in your version number to split the version number by dividing the revision by 1000. That means your version could be 1.0.65.535
  • Do not store the SVN Revision in the AssemblyVersion, but instead in the AssemblyInformationalVersion. That way your Application can still access it for display purposes, although you can't use Windows Explorer anymore to quickly check the SVN Revision
  • Do not store the SVN Revision in the AssemblyVersion, but instead in the AssemblyProduct or AssemblyDescription fields. Again, that way your Application can still access it, but also Explorer will now show it in the Property Sheet.

这篇关于.NET:AssemblyVersionAttribute中的大修订号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 01:50