.NET: Large revision numbers in AssemblyVersionAttribute

前端 未结 4 1311
遥遥无期
遥遥无期 2021-01-30 17:12

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 c

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-30 17:26

    A bit more Background information:

    Why are build numbers limited to 65535?

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

    • 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.

提交回复
热议问题