2017-09-13 1 views
-2

변경 집합 세부 사항을 얻으려면 .net 클라이언트 라이브러리를 사용하여 최신 tfs api를 사용하는 프로젝트에서 작업하고 있습니다. 그러나 나는 그렇게 할 수 없다. workitems 세부 정보를 얻을 수 있지만 사용자, 날짜 등의 체크인과 같은 변경 집합 세부 사항은 없습니다. C# 코드를 사용하여이 작업을 수행 할 수있는 방법이 있습니까? 당신은 Nuget 패키지 Microsoft.TeamFoundationServer.ExtendedClient를 설치해야변경 집합 세부 사항을위한 Tfs API

:

+0

당신은 무엇을하려고 했습니까? – isalgueiro

답변

0

난 다음, TFS에서 조회 할 API를 사용할 수있는 것은 내 코드입니다.

using System; 
using Microsoft.TeamFoundation.Client; 
using Microsoft.TeamFoundation.VersionControl.Client; 

namespace _0914_GetChangesetDetails 
{ 
    class Program 
    { 
     static void Main(string[] args) 
     { 
      TfsTeamProjectCollection tpc = new TfsTeamProjectCollection(new Uri("http://server:8080/tfs/CollectionLC")); 
      new System.Net.NetworkCredential("Domain\user", "password"); 
      tpc.EnsureAuthenticated(); 
      VersionControlServer vcs = tpc.GetService<VersionControlServer>(); 

      int cid = vcs.GetLatestChangesetId(); 
      string path = "$/0418Scrum"; 
      var history = vcs.QueryHistory(path, RecursionType.Full, 10); 
      Console.WriteLine("Following are the latest 10 changeset in " + path + ":"); 

      foreach (Changeset item in history) 
      { 
       Console.WriteLine("{0} {1} {2} {3}", item.ChangesetId, item.Owner, item.CreationDate, item.Comment); 
      } 
      Console.WriteLine("The latest changeset ID is:" + cid); 
      Console.ReadLine(); 
     } 
    } 
} 

enter image description here