Even i faced this problem with defining the version number while developing with CRM, since i wanted to deploy the same build across all the systems. I found a way to resolve it with System value + Manual + randoms.
The version information for an assembly consists of four values:
Major Version . Minor Version . Build Number . Revision
Which makes the initial Version 1.0.0.0 by default. To make more sense i replace it with
TFS Release . TFS Sprint . Change Number . Incremented build number
Suppose in your TFS a single release consists 30 sprints and after that the release becomes 2, so the values for the first release will be:
TFS Release : 1
If the current sprint is 4, the TFS Sprint will have
TFS Sprint : 4
Now the third part is managed by the developer, for a initial version we can have 0 which can be incremented +1 for each ChangeRequest or BugFix.
更改编号: 0 -- 表示初始版本
更改编号: 1 -- 表示更改
更改编号: 2 -- 表示错误修复
虽然每次错误修复都可能导致代码更改,因此默认情况下它表示代码更改。但是为了更有意义,您可以使用奇数表示更改,偶数表示错误修复。
最后一部分是默认编号,幸运的是,.Net允许我们在其中放置*以放置默认构建号。它随着每次编译/构建而递增,提供签名戳,如果其他人重新构建它,则会更改。
如何实现:
打开Properties文件夹中的AssemblyInfo.cs并注释掉AssemblyFileVersion,这将使AssemblyFileVersion和AssemblyVersion相同。
[assembly: AssemblyVersion("1.4.2.*")]
最终版本将会是:
1.4.2.4512 或者其他类似的版本号。
这种方法的好处在于你可以追踪生成代码的任务。只需要看版本号,我就能说:“嘿,这是第4个冲刺的第一个发布版本,并且进行了一些代码更改。”