【问题标题】:Detecting the Team Project Collection in Team Foundation Server 2010在 Team Foundation Server 2010 中检测团队项目集合
【发布时间】:2011-11-14 22:05:46
【问题描述】:

我正在使用 Team Foundation Server API 尝试连接到远程服务器。

在我的应用程序中,我尝试连接到 https://some-tfs-location.example.com/tfs 形式的 URL,但这样做时我收到错误 TF50309(已讨论 here)。如果我将项目集合添加到 URL 的末尾(因此路径变为 tfs/101),那么我可以毫无问题地连接。

我想尝试模仿 Visual Studio 的行为,我可以在其中给它一个 URL 而无需指定项目集合,它会连接并定位项目集合。

有人对我可以使用哪些 API 来模仿 Visual Studio 行为有任何建议吗?我曾希望通过

找到项目集合
TfsTeamProjectCollection ttpc = new TfsTeamProjectCollection(projectRoot.ServerUrl,new MyCredentials());
var projectCollection = ttpc.CatalogNode.FullPath;

但这会导致相同的 TF50309 错误代码。

【问题讨论】:

    标签: tfs tfs-sdk


    【解决方案1】:

    您可以将TfsConfigurationServer类与没有团队项目集合的服务器Uri(例如http://localhost:8080/tfs)一起使用,获取ITeamProjectCollectionService服务,并使用GetCollections方法或GetDefaultCollection方法来检索您想要的集合。

    blog post 对此进行了更详细的描述。

    【讨论】:

      猜你喜欢
      • 2011-01-12
      • 2017-08-08
      • 1970-01-01
      • 2016-08-16
      • 2016-02-12
      • 2017-01-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多