2

我需要移动包含 TFS 构建的文件共享,因此我编写了一些代码来遍历构建集合并更新它们的放置位置。我知道代码做了一些事情,因为当我在第二次运行时调试代码时,droplocation 现在显示新的 unc 路径。但是,当我进入团队资源管理器并单击“放置位置”进行构建时,我会被带到旧位置。

我错过了什么?

var buildServer = tpc.GetService<IBuildServer>();
                        foreach (var build in buildServer.QueryBuilds(projectName))
                        {
                            string newDropLocation = FixPath(build.DropLocation);
                            string newLogLocation = FixPath( build.LogLocation);

                            build.DropLocation = newDropLocation;
                            if(!String.IsNullOrEmpty(newLogLocation))
                            {
                                build.LogLocation = newLogLocation;
                            }
                            build.Save();

                            Console.WriteLine("------------");
                            Console.WriteLine(newDropLocation);
                            Console.WriteLine(newDropLocationRoot);
                            Console.WriteLine(newLogLocation);
                        }
4

1 回答 1

0

似乎此功能现在已内置到Community TFS Build Extensions中。社区 TFS 构建管理器能够搜索和替换现有构建的更新。

于 2013-05-02T14:29:03.647 回答