我在以下代码中查找项目区域但是如何获得tfs项目的默认araea
快速帮助将非常感激
foreach (Node area in teamProject.AreaRootNodes)
{
foreach (Node item in area.ChildNodes)
{
}
}
答案 0 :(得分:0)
项目本身没有默认区域,只有团队的区域,为团队项目创建默认团队,因此我的团队项目将有一个团队调用我的团队项目(或类似),并且会有默认的区域路径。
然后你可以这样做:
TfsTeamProjectCollection collection = GetServer("<server_uri>");
string projectUri = GetProject(collection, "<project_name");
var configSvc = collection.GetService<TeamSettingsConfigurationService>();
var configs = configSvc.GetTeamConfigurationsForUser(new[] { projectUri });
foreach (TeamConfiguration config in configs)
{
// Output some basic team info.
Console.WriteLine("Team name: {0}", config.TeamName);
Console.WriteLine("Team ID: {0}", config.TeamId);
Console.WriteLine("Is default team: {0}", config.IsDefaultTeam);
// Access the actual configuration settings.
TeamSettings ts = config.TeamSettings;
// Output the information on the teams iterations.
Console.WriteLine("Product backlog: {0}", ts.BacklogIterationPath);
Console.WriteLine("Current iteration: {0}", ts.CurrentIterationPath);
Console.WriteLine("Team iteration paths:");
foreach (string path in settings.IterationPaths)
Console.WriteLine(" {0}", path);
}