internal static BranchHistoryTreeItem[][] GetHistory() { // Get a reference to our Team Foundation Server. String tfsName = @" http://tfsServer:8080 "; TeamFoundationServer tfs = new TeamFoundationServer(tfsName); // Get a reference to Version Control. VersionControlServer versionControl = (VersionControlServer)tfs.GetService(typeof(VersionControlServer)); ItemSpec[] itemSpec = new ItemSpec[1]; itemSpec[0] = new ItemSpec(@"$/TempTeamProject2/", RecursionType.Full); BranchHistoryTreeItem[][] branchHistoryTree = versionControl.GetBranchHistory(itemSpec, VersionSpec.Latest); foreach (BranchHistoryTreeItem[] tia in branchHistoryTree) { foreach (BranchHistoryTreeItem ti in tia) { Console.WriteLine(ti.Relative.ToString()); } } return branchHistoryTree; }