【问题标题】:Microsoft.TeamFoundationServer.ExtendedClient Nuget package does not install Microsoft.TeamFoundation.Common.dllMicrosoft.TeamFoundationServer.ExtendedClient Nuget 包不安装 Microsoft.TeamFoundation.Common.dll
【发布时间】: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


【解决方案1】:

Microsoft.TeamFoundationServer.ExtendedClient Nuget 包不安装 Microsoft.TeamFoundation.Common.dll

正如 Eddie 所说,Microsoft.TeamFoundation.Common.dll 文件包含在包 Microsoft.VisualStudio.Services.Client 中,这是包 Microsoft.TeamFoundationServer.ExtendedClient 的依赖项之一:

所以,要解决此问题,请检查解决方案资源管理器的 参考 节点下是否存在文件 Microsoft.TeamFoundation.Common.dll。如果不存在,请在 Package Manager Console 中执行以下 NuGet 命令行:

Update-Package -reinstall

强制将包引用重新安装到项目中。如果它被意外删除或丢失,恢复包,清理和重建,清除我的 Nuget 缓存不会修改项目以添加 dll 文件。

【讨论】:

    猜你喜欢
    • 2018-10-22
    • 1970-01-01
    • 2021-11-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-05-19
    • 2019-04-15
    相关资源
    最近更新 更多