关于如何从TFS获取集合参考here https://stackoverflow.com/questions/16100991/how-to-get-all-collections-from-tfs/16100992#16100992
请参考here http://blog.johnsworkshop.net/更多细节。这是有关 TFS 内容的最佳资源之一。
传入集合 GUID,列表返回该特定集合中所有项目的名称。
public IList<string> GetProjectsFormCollection(Guid collectionId)
{
ICommonStructureService structureService = null;
try
{
TfsTeamProjectCollection teamProjectCollection =
_configurationServer.GetTeamProjectCollection(collectionId);
teamProjectCollection.Authenticate();
structureService =
(ICommonStructureService)teamProjectCollection.GetService(typeof(ICommonStructureService));
}
catch (Exception e)
{
ApplicationLogger.Log(e);
}
var projectInfoList = new List<ProjectInfo>(structureService.ListAllProjects());
IEnumerable<string> data = projectInfoList.Select(proj => proj.Name);
List<string> list = data.ToList();
return list;
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)