构建Workitem商店时出现异常

时间:2016-03-02 06:12:35

标签: c# tfs tfs2013 tfs-sdk

我正在尝试从TFS查询一些工作项,但是在GetService时,我得到了异常。有人可以帮助我。

 ICredentials networkCredential = new NetworkCredential("XXX", "XX", "XXX");
 Uri tfsUri = new Uri(@"http://tfs:8080/tfs/DefaultCollection");
 TfsTeamProjectCollection tfs = new TfsTeamProjectCollection(tfsUri, networkCredential);
 tfs.EnsureAuthenticated();
 WorkItemStore Store = (WorkItemStore)tfs.GetService(typeof(WorkItemStore));

错误

  

未处理的类型' System.IO.FileNotFoundException'   发生在Microsoft.TeamFoundation.WorkItemTracking.Client.dll

中      

其他信息:无法加载文件或程序集   ' Microsoft.TeamFoundation.WorkItemTracking.Proxy,Version = 11.0.0.0,   Culture = neutral,PublicKeyToken = b03f5f7f11d50a3a'或其中一个   依赖。系统找不到指定的文件。

enter image description here

1 个答案:

答案 0 :(得分:1)

错误似乎很明显:您错过了Microsoft.TeamFoundation.WorkItemTracking.Proxy。安装TFS 2012对象模型并将该程序集的引用添加到项目中。我说2012年,因为版本11.x表示TFS 2012. 12将是2013年,14将是2015年。