我正在尝试通过Azure WebJob在线连接到TFS。一切顺利,直到我尝试执行这一行。
WorkItemStore workItemStore = tpc.GetService<WorkItemStore>();
我收到以下错误:
[03/06/2015 15:32:26&gt; cb28d4:ERR]未处理的异常: System.IO.IOException:指定的注册表项不存在。 [03/06/2015 15:32:26&gt; cb28d4:ERR] at Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode,String str) [03/06/2015 15:32:26&gt; cb28d4:ERR] at Microsoft.Win32.RegistryKey.CreateSubKeyInternal(String子键, RegistryKeyPermissionCheck permissionCheck,Object registrySecurityObj,RegistryOptions registryOptions)
答案 0 :(得分:0)
由于未在那里安装团队资源管理器,因此无法使用Azure Web作业中的TFS API。
您需要使用其余的API。
https://www.visualstudio.com/en-us/integrate/get-started/rest/basics
答案 1 :(得分:-1)
http://knowledge-base.havit.cz/2015/01/06/pristup-k-team-foundation-serveru-z-azure-website/
NetworkCredential networkCredential = new NetworkCredential(_userName, _password, null);
TfsClientCredentials tfsClientCredentials = new TfsClientCredentials(new WindowsCredential(networkCredential),
new SimpleWebTokenCredential(null, null), allowInteractive: false);
TfsTeamProjectCollection teamProjectCollection = new TfsTeamProjectCollection(uri, tfsClientCredentials);
WorkItemStore workItemStore = new WorkItemStore(teamProjectCollection);