MSBuild TFS Build Number

我怕爱的太早我们不能终老 提交于 2019-12-03 06:33:33
technophile

Assuming you mean Team Build, the $(BuildNumber) property contains the current build number.

See http://blogs.msdn.com/aaronhallberg/archive/2008/02/12/team-build-2008-property-reference.aspx for a full reference of available properties.

If you're just running MSBuild, I don't believe it generates/applies an overall build number (each project will have an individual, possibly auto-incremented, version number in its AssemblyInfo.cs [by default] file). You can dynamically get this version number for a specific assembly using the System.Reflection.Assembly class at runtime.


Update

As of TFS 2010, the 'BuildNumber' variable is no longer automatically passed to the MSBuild process by TFS. TFS 2010 now uses Windows Workflow as its internal build engine, so if you want the build number, you'll have to modify your build definition to include it, as mentioned in this MSDN article.

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