3

I am at present setting up my ASP.NET MVC 4 web application with publish profiles and the associated publishing features. My continuous integration (CI) environment is Team Foundation Server (TFS) build 2010 and TFS for source control.

I have a number of requirements that I would like to achieve with this. Firstly, each time I create the publish package for release, I would like the build number to be incremented and revision number reset to 0 in my version file. I currently have one version file that contains the version number of Major.Minor.Build.Revision. So I would like the creation of the publishing package to do such. Is this possible and if so how is it achieved? Note as this increments the version file, as part of this process I would like this checked in to source control.

My second question is that each time a developer checks in to the TFS build server, the revision number will get incremented or at least changed to a new value. I had hoped to update my build template to achieve this, but unfortunately due to restrictions on my build server I can not incorporate any custom activities on it. So I am looking to perform this task with MSBuild. Is it possible to achieve what I outlined here with MSBuild and if so, could I get an explanation please?

4

3 回答 3

0

Team Foundation Build Customization Guide有 10 页关于此主题(此处复制的内容太多了)。本指南由Visual Studio ALM Rangers制作,与官方指南非常接近。

于 2012-11-11T05:09:31.577 回答
0

查看这些 Stack Overflow 对Working automatic build increment Visual Studio addinAuto update version numbers (C++ / C#) in Visual Studio 2005 的回答。

我希望你能找到解决办法。ProjectBuildCounter 是一个独立的独立设备,可以附加到项目以及 TFS 事件处理程序。

于 2013-03-31T19:28:48.950 回答
0

这是一篇旧博客文章,但它可能仍然有效:如何:使用 MSBuild 更新程序集版本号

于 2012-11-09T16:09:05.723 回答