Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/tfs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在TFS项目中查找标签_C#_Tfs - Fatal编程技术网

C# 在TFS项目中查找标签

C# 在TFS项目中查找标签,c#,tfs,C#,Tfs,我目前正在使用以下代码通过指定的标签查找tfs项目中的分支: TfsTeamProjectCollection tfs = new TfsTeamProjectCollection(new Uri(tfsuri)); var vcs = tfs.GetService<VersionControlServer>(); string labelscope = labelscopepath; var specifiedBranch = vcs.QueryLabels(label, l

我目前正在使用以下代码通过指定的标签查找tfs项目中的分支:

TfsTeamProjectCollection tfs = new TfsTeamProjectCollection(new Uri(tfsuri));

var vcs = tfs.GetService<VersionControlServer>();

string labelscope = labelscopepath;

var specifiedBranch = vcs.QueryLabels(label, labelscope, null, true);
tfstreamprojectcollection tfs=新的tfstreamprojectcollection(新Uri(tfsuri));
var vcs=tfs.GetService();
字符串标签镜=标签镜路径;
var specifiedBranch=vcs.querylabel(标签,标签镜,null,true);
但这样我只在知道标签名称时才得到分支。所以我现在需要的是一种方法来查找指定项目和相关分支中的所有标签

这是我的TFS结构。分支“Branch2”有标签“Label1”。现在我想列出所有有标签的分支,包括labelname。在这种情况下,此列表中只有Branch2


您可以先获得标签列表,然后列出具有标签的分支

public VersionControlLabel[] QueryLabels(String labelName,
                                         String labelScope,
                                         String owner, 
                                         bool includeItems,
                                         String filterItem,
                                         VersionSpec versionFilterItem)

更多详细信息请参阅本博客:您甚至可以在下面以编程方式显示标签对话框。

好的,我知道了。必须将labelName设置为“null”才能获取所有标签。谢谢Patrick MSFT你的博客文章帮助我理解了这一点。