gpt4 book ai didi

TFS API TestManagementService 总是返回 null

转载 作者:行者123 更新时间:2023-12-04 18:46:53 25 4
gpt4 key购买 nike

我正在尝试使用 TFS API 获取测试计划。

TfsTeamProjectCollection tfs = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri("http://xxxxxxx:8080/tfs/DefaultCollection"));

var service = (ITestManagementService)tfs.GetService(typeof(ITestManagementService));

变量“service”始终返回 null。

你有什么想法,为什么?

最佳答案

在调用 Get Service 命令之前,请尝试确保您已通过 Team Project Collection 的身份验证。此代码片段对我来说正常工作:

TfsTeamProjectCollection tpc = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri("https://tfs.companyname.com/tfs/DefaultCollection"));
tpc.EnsureAuthenticated();

ITestManagementService service = tpc.GetService<ITestManagementService>();

关于TFS API TestManagementService 总是返回 null,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12686596/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com