2

I installed linqpad a while ago and recently I came across some articles on how to use it to query against tfs. Basic queries like checkins and checkouts and things of that nature. I have had mostly success with running those queries. Then I see this website showing that it is possible to query against tfs with linqpad basically giving you the ability to do a codesearch with linqpad. So I spent a very good amount of time attempting to get this to work.

http://pascallaurin42.blogspot.com/2012/05/tfs-queries-searching-in-all-files-of.html

この男は linqpad を利用して tfs をクエリすることに本当に優れていると言わざるを得ません。私が遭遇しているのは、これを実行すると、私のバージョンの tfs ではチームブランチが許可されていないというエラーが表示されることです.これを tfs2008 で動作させることができれば素晴らしいことです。とにかく、これに関する助けやアイデアは大歓迎です....ありがとう。

4

1 に答える 1

2

TFS 2008 は、TFS 2010 で導入された「ファーストクラス」ブランチの概念を理解しないため、versionControl.QueryRootBranchObjects() メソッドは TFS 2008 サーバーに対してサポートされていません。ブランチの独自のリスト。

たとえば、上記のサンプルの 11 ~ 25 行目を次のコードに置き換えると、次のように動作するはずです。

var teamBranches = new String[] { "$/project/Main", "$/project/Dev" };

filePatterns.Dump("File patterns");  
textPatterns.Dump("Text patterns");    

foreach (var teamBranch in teamBranches)   
    foreach (var filePattern in filePatterns)    
        foreach (var item in versionControl.GetItems(teamBranch + "/"     + filePattern, RecursionType.Full).Items)     

SearchInFile(item); 

明らかに、$/project/main と $/project/dev を検索したいブランチに置き換えたいと思うでしょう。

ご不明な点がございましたら、お知らせください。

編集

TFS 2008 を使用しているため、他のいくつかの行も微調整する必要があります。含める代わりに

Microsoft.TeamFoundation.Framework.Client

含めるだけ

Microsoft.TeamFoundation.Client

そして、この行の代わりに:

var tfs = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri("http://localhost:8088/tfs")); 

これを試して

// Note, 2008 servers don't use "/tfs" and I can't remember if they take a Uri
// or a string.
var tfs = new TeamFoundationServer("http://localhost:8080");
于 2012-09-17T21:06:02.247 に答える