我可以创建项目/删除/重命名所有东西,但是当它来获取组时,它说"API资源位置ebbe6af8-0b91-4c13-8cf1-777c14858188没有在http://khanamar3:8080/tfs/DefaultCollection/上注册“,请帮助.....
public PagedGraphGroups GetAllGroups()
{
VssConnection connection = Context.Connection;
GraphHttpClient graphClient = connection.GetClient<GraphHttpClient>();
//error coming in next line...
PagedGraphGroups groups = graphClient.GetGroupsAsync().Result;
foreach (var group in groups.GraphGroups)
{
LogGroup(group);
}
return groups;
}发布于 2019-09-04 21:24:24
可能有两个问题
未在{1}上注册
API资源位置{0}
1.使用URL
我认为它应该没有缺省集合,所以在你的例子中
http://khanamar3:8080/tfs/
2.使用TFS/API版本(我自己也有这个问题)
2.1
首先在TFS管理中检查TFS服务器的版本,例如
Microsoft:\Program Files\
Team Foundation Server 2018\Tools\TfsMgmt.exe
一旦你知道了你的TFS服务器版本,你就可以看到它支持的API版本
https://docs.microsoft.com/en-us/rest/api/azure/devops/?view=vsts-rest-tfs-4.1
例如,API 2018更新1支持版本4.0

2.2
然后检查您使用的DLL调用的API版本。我在nuget网站https://www.nuget.org/packages/Microsoft.TeamFoundationServer.Client/上找不到这些信息
更新:您可以在此处检查哪个dll版本支持哪个TFS版本: https://docs.microsoft.com/en-us/azure/devops/integrate/concepts/dotnet-client-libraries?view=azure-devops
但是,正如这里所描述的,您可以使用ILSpy检查该方法传递的How to specify the API version?版本
在您的示例中,方法为:
GetGroupsAsync
您可以使用https://marketplace.visualstudio.com/items?itemName=SharpDevelopTeam.ILSpy检查这一点

在我的例子中,它看起来像这样

因此,nuget版本16.153.0的API使用带有5.1.1的调用
因此,在我的案例中,TFS2018更新1不支持API版本5.1.1,因此我将需要降级nuget或升级TFS版本(或两者)
发布于 2017-06-02 13:23:37
您可以结合使用IIdentityManagementService和ListApplicationGroups来获取应用程序组的列表。
TeamFoundationIdentity[] ListApplicationGroups(
string scopeId,
ReadIdentityOptions readOptions
)示例代码
var applicationGroups = identityManagementService.ListApplicationGroups(projectcollection.Uri.AbsoluteUri, ReadIdentityOptions.None);还要看一下这个类似的问题:TFS 2013 get All TFS group including Windows group
https://stackoverflow.com/questions/44299586
复制相似问题