应用更新 2 VisualStudio 2015 Enterprise 后无法连接到 TFS - 异常 TF205020

After applying update 2 VisualStudio 2015 Enterprise can't connect to TFS - exception TF205020

VisualStudio 2015.1 Enterprise/TFS 在应用 VS2015 更新 2 之前集成工作正常。

Reinstalling/repairing VisualStudio 没有解决这个问题,继续获取:

TF205020: Could not connect to server ...... The server returned the following error:

Could not load type Microsoft.VisualStudio.Services.WebApi.Utilities.UserAgentUtility' from assembly 'Microsoft.VisualStudio.Services.WebApi, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

设置:

VS 企业版 2015.2 TFS 2015.2

缩小这个问题的范围:

  1. 检查 Windows 事件查看器以获取更多错误信息。
  2. 尝试清除 TFS 和 VS 缓存,详细步骤blog
  3. 尝试确保您可以访问 TFS 网站 访问http://:8080/tfs/web/

我们在这里遇到了同样的问题。在删除缓存、用户配置文件文件夹和注册表设置后重新安装 Visual Studio 2015 对我们没有帮助。看起来 TestComplete 11.31 安装在 GAC 中安装了一些与 Visual Studio 2015 Update 2 冲突的程序集。我们修复了比较两个几乎相同的系统(一个有 TestComplete 和一个没有 TestComplete)的问题,我们从 % WINDOWS%\Microsoft.NET\assembly 文件夹:

  • Micorosft.VisualStudio.Services.Client
  • Micorosft.VisualStudio.Services.Common
  • Micorosft.VisualStudio.Services.Integration
  • Micorosft.VisualStudio.Services.WebApi

但是问题依然存在。删除后:

  • Microsoft.TeamFoundation.Client
  • Microsoft.TeamFoundation.WorkItemTracking.Common

问题解决了!

希望这对您的问题有所帮助...

同这个问题:Extension fails to load on VS2015.2,尝试里面的解决方案:

Can you check if Microsoft.VisualStudio.Services.WebApi.dll is installed into the GAC? The easiest way to do this is to check if there is a folder that starts with v14.0.0.0 under the c:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.VisualStudio.Services.WebApi.

I suspect you have an assembly from VS 2015 RTM or VS 2015 Update 1 in the GAC. Uninstalling it, will fix the issue.

感谢 Ernstjan Freriks,这些附加信息(最初来自 Microsoft Connect)对我有所帮助:

The Tfs client binaries should not be in your GAC. The only way they would get there is to add them yourself, or install some 3rd party application that has added them. Once they are in the GAC they will be loaded instead of the binary that matches your version of TeamExplorer or tf.exe. You need to remove all instances of any Team Foundation binary from the GAC including the following:

Microsoft.TeamFoundation.Build2.WebApi.dll
Microsoft.TeamFoundation.Chat.WebApi.dll
Microsoft.TeamFoundation.Common.dll
Microsoft.TeamFoundation.Core.WebApi.dll
Microsoft.TeamFoundation.Diff.dll
Microsoft.TeamFoundation.Discussion.Client.dll
Microsoft.TeamFoundation.Discussion.WebApi.dll
Microsoft.TeamFoundation.Git.Client.dll
Microsoft.TeamFoundation.Lab.Client.dll
Microsoft.TeamFoundation.Lab.Common.dll
Microsoft.TeamFoundation.Lab.TestIntegration.Client.dll
Microsoft.TeamFoundation.Lab.WorkflowIntegration.Client.dll
Microsoft.TeamFoundation.Policy.WebApi.dll
Microsoft.TeamFoundation.ProjectManagement.dll
Microsoft.TeamFoundation.SharePointReporting.Integration.dll
Microsoft.TeamFoundation.SourceControl.WebApi.dll
Microsoft.TeamFoundation.Test.WebApi.dll
Microsoft.TeamFoundation.TestImpact.Client.dll
Microsoft.TeamFoundation.TestManagement.Client.dll
Microsoft.TeamFoundation.TestManagement.Common.dll
Microsoft.TeamFoundation.TestManagement.WebApi.dll
Microsoft.TeamFoundation.VersionControl.Client.dll
Microsoft.TeamFoundation.VersionControl.Common.dll
Microsoft.TeamFoundation.VersionControl.Common.Integration.dll
Microsoft.TeamFoundation.Work.WebApi.dll
Microsoft.TeamFoundation.WorkItemTracking.Client.DataStoreLoader.dll
Microsoft.TeamFoundation.WorkItemTracking.Client.dll
Microsoft.TeamFoundation.WorkItemTracking.Client.QueryLanguage.dll
Microsoft.TeamFoundation.WorkItemTracking.Common.dll
Microsoft.TeamFoundation.WorkItemTracking.Proxy.dll
Microsoft.TeamFoundation.WorkItemTracking.WebApi.dll
Microsoft.VisualStudio.Services.Client.dll
Microsoft.VisualStudio.Services.Common.dll
Microsoft.VisualStudio.Services.WebApi.dll

You can use gacutil to remove these. Once removed your issue should be fixed.