检测 Team Foundation Server 2010 中的团队项目集合

发布于 2024-12-15 12:31:46 字数 770 浏览 3 评论 0原文

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

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

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

有人对我可以使用哪些 API 来模仿 Visual Studio 行为有任何建议吗?我本来希望通过找到项目集合

TfsTeamProjectCollection ttpc = new TfsTeamProjectCollection(projectRoot.ServerUrl,new MyCredentials());
var projectCollection = ttpc.CatalogNode.FullPath;

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

I'm using the Team Foundation Server API to try to connect to a remote server.

From within my application, I try to connect to a URL of the form https://some-tfs-location.example.com/tfs but when doing so I get an error TF50309 (discussed here). If I add the project collection to the end of the URL (so the path becomes tfs/101) then I can connect with no problems.

I'd like to try and mimic the behaviour of Visual Studio, where I can give it a URL without needing to specify the project collection and it'll connect and locate the project collection.

Does anyone have any suggestions which API's I can use to mimic the Visual Studio behaviour? I had hoped to find the project collection via

TfsTeamProjectCollection ttpc = new TfsTeamProjectCollection(projectRoot.ServerUrl,new MyCredentials());
var projectCollection = ttpc.CatalogNode.FullPath;

But this results in the same TF50309 error code.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

嘿看小鸭子会跑 2024-12-22 12:31:46

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

这个博客文章 更详细地描述了它。

You can use the TfsConfigurationServer class with the server Uri that has no team project collection (e.g. http://localhost:8080/tfs), get the ITeamProjectCollectionService service, and use GetCollections method or GetDefaultCollection method to retrieve the collection you want.

This blog post described it in more details.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文