创建一个控制台应用程序,用于TFS中的区域生产自动化,因为我们的团队可以生产更多的项目。一旦应用程序创建区域,我们仍然必须手动执行的一件事是将该区域的继承切换为关闭,因为它是默认情况下是。有没有什么办法可以在C#中使用Visual Studio中的TFS'API?如何使用API在TFS中切换区域的继承?
这是我如何创建区域:
static void CreateArea()
{
string collectionUri = "collectionUri";
string projectName = "projectName";
string areaName = "areaName";
TfsTeamProjectCollection tpc = new TfsTeamProjectCollection(new Uri(collectionUri));
ICommonStructureService commonStructures = tpc.GetService<ICommonStructureService>();
// Root area of the project
NodeInfo rootAreaNode = commonStructures.GetNodeFromPath(projectName + "\\Area");
// Create the new area node
string newAreaUri = commonStructures.CreateNode(areaName, rootAreaNode.Uri);
Console.WriteLine("Created Area: '" + areaName + "'.");
}
什么的''继承你指向?您是否指新创建地区的**安全**相关的继承许可? –