Generating version number in MSBuild

前提是你 提交于 2019-12-01 05:10:46

The MSbuild Community Tasks contains a task named Version, it provides some algorithms to generate version numbers. It is very easy to use and customizable.

IMHO, it is better to use a number that ties your entire SDLC, so you can trace your deployed product to the build results, and these to the VCS, and so forth. I would recommend using jenkins build number, as Christopher Painter did.

You can get the version number from an assembly by using !(bind.FileVersion.FileId) where FileId is the ID of a File element as defined in one of your wxs files.

Then just let .NET generate the Assembly numbers and WiX will use it as the ProductVersion.

Why wouldn't you tie it to Jenkins? Seems like you'd want Jenkins to manager the properties that get passed into a build including version number. That's how I've done it with BuildForge, TFS et al.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!