TFS工作项目的回报总是空

编程入门 行业动态 更新时间:2024-10-19 23:43:59
本文介绍了TFS工作项目的回报总是空的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

下面workItemStore始终返回null .....我想登陆TP TFS问题作为猪兔。但不能becoz空exception..help的这么做是grealy AP preciated ......谢谢你......

VAR的NetworkCredential =新的NetworkCredential(用户名,密码,域名);VAR凭证=(ICredentials)的NetworkCredential;//连接到TFS项目集合,提供服务器的URL格式http://服务器:端口/收藏VAR TFS =新TfsTeamProjectCollection(TfsTeamProjectCollection.GetFullyQualifiedUriForName(TfsConnectionUri),证书);//检查是否有效TFS用户或不tfs.EnsureAuthenticated();VAR workItemStore =(WorkItemStore)tfs.GetService(typeof运算(WorkItemStore));//迭代通过项目    的foreach(在workItemStore .Projects项目tfs_project)    {       Console.WriteLine(tfs_project.Name);       //执行WIQL查询       WorkItemCollection WIC = wis.Query(          SELECT [System.Id],[System.WorkItemType],+          [System.State],[System.AssignedTo],[System.Title]+          FROM WorkItems对比+          WHE​​RE [System.TeamProject] ='+ tfs_project.Name +          'ORDER BY [System.WorkItemType],[System.Id]);       的foreach(WIC中的无线网络连接工作项)       {         Console.WriteLine(wi.Title +[+ wi.Type.Name +]+ wi.Description);       }     }

解决方案

尝试这种方式来创建WorkItemStore

TfsTeamProjectCollection TFS =新TfsTeamProjectCollection(新的URI(TfsServerURI),NC);VAR _wis =新WorkItemStore(TFS);

Here workItemStore always returns null.....i want log issues tp TFS as a nugs. But not able to do so becoz of null exception..help is grealy appreciated...Thank you....

var networkCredential = new NetworkCredential(userName, password, domainName); var credential = (ICredentials)networkCredential; //Connect to TFS Project Collection, provide server URL in format ServerName:Port/Collection var tfs = new TfsTeamProjectCollection( TfsTeamProjectCollection.GetFullyQualifiedUriForName(TfsConnectionUri), credential); //Check whether valid TFS user or not tfs.EnsureAuthenticated(); var workItemStore = (WorkItemStore)tfs.GetService(typeof(WorkItemStore)); //Iterate Through Projects foreach (Project tfs_project in workItemStore .Projects) { Console.WriteLine(tfs_project.Name); //Perform WIQL Query WorkItemCollection wic = wis.Query( " SELECT [System.Id], [System.WorkItemType],"+ " [System.State], [System.AssignedTo], [System.Title] "+ " FROM WorkItems " + " WHERE [System.TeamProject] = '" + tfs_project.Name + "' ORDER BY [System.WorkItemType], [System.Id]"); foreach (WorkItem wi in wic) { Console.WriteLine(wi.Title + "["+wi.Type.Name+"]"+wi.Description); } }

解决方案

Try it this way to create the WorkItemStore

TfsTeamProjectCollection tfs = new TfsTeamProjectCollection(new Uri(TfsServerURI), nc); var _wis = new WorkItemStore(tfs);

更多推荐

TFS工作项目的回报总是空

本文发布于:2023-11-27 21:51:44,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1639726.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:项目   工作   TFS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!