VssResourceNotFoundException:API 资源位置 <GUID> 未在 {tfs url} 上注册 - c#

kar*_*arz 4 .net c# tfs tfs-sdk

我正在尝试使用BuildHttpClient获取集合的构建信息。但它在扔

VssResourceNotFoundException:API 资源位置 {GUIS} 未在http://tfsserver/tfs 上注册

以下代码示例产生错误:

 var url = new Uri("http://tfsserver:8080/tfs");
 TfsTeamProjectCollection ttpc = new TfsTeamProjectCollection(url);
 BuildHttpClient client = ttpc.GetClient<BuildHttpClient>();
 List<Build> builds = client.GetBuildsAsync().Result;
Run Code Online (Sandbox Code Playgroud)

Dan*_*ann 5

您正在指定 TFS 服务器的位置,而不是项目集合。您需要在 URI 中指定一个项目集合。

前任: var url = new Uri("http://tfsserver:8080/tfs/DefaultCollection");