【发布时间】:2019-02-03 11:28:22
【问题描述】:
我正在构建一个项目,其中涉及对 TFS 扩展客户端 Nuget 包的一些调用。每当我使用TfsTeamProjectCollection 类拨打电话时,都会抛出一个错误,提示找不到Microsoft.TeamFoundation.Common.dll。我试图恢复我所有的包,清理和重建,清除我的 Nuget 缓存和恢复,甚至多次完全重新安装 VS2017,但无济于事。我正在处理这个项目的另一位同事没有遇到这个问题。我目前正在临时使用他们的 DLL,方法是将其复制到我的解决方案中所有项目的 bin 以及我的Microsoft.TeamFoundationServer.ExtendedClient 的库中。如何确保软件包安装了 Common DLL?
这是我在项目中运行某个操作时引发的特定错误:
System.IO.FileNotFoundException
HResult=0x80070002
Message=Could not load file or assembly 'Microsoft.TeamFoundation.Common, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Source=Microsoft.TeamFoundation.Client
StackTrace:
at Microsoft.TeamFoundation.Client.TfsTeamProjectCollection.GetFullyQualifiedUriForName(String name)
at [method call] in [file name]
at [parent method call] in [same file name]
at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters)
at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f()
【问题讨论】:
-
可能这个 dll 安装在 GAC 中?
-
您安装的是哪个版本?当您安装“Microsoft.TeamFoundationServer.ExtendedClient”时,您能否检查是否安装了“Microsoft.VisualStudio.Services.Client”包? “Microsoft.TeamFoundation.Common.dll”文件包含在“Microsoft.VisualStudio.Services.Client”中。
-
@EddieChen-MSFT 我刚刚检查了 Microsoft.VisualStudio.Services.Client,它就在那里。我正在阅读 Leo 的回答,一切顺利。感谢您的帮助!
标签: c# .net visual-studio tfs nuget