您可以使用Team Foundation Build环境变量TF_BUILD_BUILDNUMBER获取Build number。有关更多信息,请阅读Team Foundation Build环境变量文章。