1

我有一个包含 48 个 C# 项目的 Visual Studio 解决方案。现在,我想自动对所有项目进行版本控制,我刚刚将 GitVersionTask 的 Nuget 包添加到所有项目(版本 4.0.0-beta0012)。当我在本地构建解决方案时,一切正常。新构建的二进制文件包含 gitversion 生成的版本信息。

但是当我尝试通过我们的 TFS 构建服务器进行构建时,它正在对分支进行一些操作。这是构建日志的一些压缩输出:

2018-03-14T14:34:38.0434047Z UpdateAssemblyInfo:
2018-03-14T14:34:38.0434047Z   INFO [03/14/18 15:34:38:04] Applicable build agent found: 'VsoAgent'.
2018-03-14T14:34:38.0434047Z   INFO [03/14/18 15:34:38:04] Branch from build environment: refs/heads/sprint022/add-gitversion
2018-03-14T14:34:38.0590291Z   INFO [03/14/18 15:34:38:05] Begin: Normalizing git directory for branch 'refs/heads/sprint022/add-gitversion'
2018-03-14T14:34:38.3402986Z     INFO [03/14/18 15:34:38:34] One remote found (origin -> 'https://link-to-our-git-repo-on-tfs').
2018-03-14T14:34:38.3559076Z     INFO [03/14/18 15:34:38:35] Skipping fetching, if GitVersion does not calculate your version as expected you might need to allow fetching or use dynamic repositories
2018-03-14T14:34:38.4652918Z     INFO [03/14/18 15:34:38:46] Updating local branch refs/heads/sprint022/add-gitversion to point at e8d694a08080c8117b9c6cf93032c16057b05dab
2018-03-14T14:34:38.7621669Z     INFO [03/14/18 15:34:38:76] Skipping update of 'refs/remotes/origin/3620_Error_Handling_Refactoring' as it already matches the remote ref.

...对于我们远程存储库上的每个分支,都会重复最后一条消息“跳过...的更新,因为它已经与远程引用匹配”。由于这是相当多的分支,对于解决方案中的一个项目,这需要将近一分钟。因此,对于整个解决方案,我们将为此花费将近一小时的时间。

我已经花了很多时间研究这个,但我仍然无法在网上找到任何有用的东西。

有人知道为什么 TFS 将其作为解决方案构建的一部分,而本地 Visual Studio 构建不这样做吗?

4

0 回答 0