I am building a project which involves using some calls to the TFS Extended Client Nuget package. Whenever I go to to make a call using the TfsTeamProjectCollection
class, an error is thrown saying that the Microsoft.TeamFoundation.Common.dll
can't be found. I've attempted to restore all my packages, clean and rebuild, clear my Nuget cache and restore, and even a complete reinstall of VS2017 several times with no avail. The other colleague I'm working on this project with is not running into this issue. I'm currently using their DLL temporarily by copying it into the bins for all the projects in my solution as well as into the lib of my Microsoft.TeamFoundationServer.ExtendedClient
. How can I ensure that the package installs the Common DLL?
Here is the specific error that gets thrown when I run a certain operation in my project:
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()
Microsoft.TeamFoundationServer.ExtendedClient Nuget package does not install Microsoft.TeamFoundation.Common.dll
Just as Eddie said, the Microsoft.TeamFoundation.Common.dll
file is included in the package Microsoft.VisualStudio.Services.Client
, which is one of a dependency of package Microsoft.TeamFoundationServer.ExtendedClient
:
So, to resolve this issue, please check if the file Microsoft.TeamFoundation.Common.dll
exists under the Reference node on the solution explorer. If it does not exist, please execute following NuGet command line in the Package Manager Console:
Update-Package -reinstall
to force reinstall the package references into project. If it was accidentally deleted or lost, restore packages, clean and rebuild, clear my Nuget cache would not modify the project to add the dll file back.
User contributions licensed under CC BY-SA 3.0