6
using Microsoft.TeamFoundation.TestManagement.Client;

I've encountered - TypeLoadException was unhandled

Error Description Says:

Could not load type 'Microsoft.TeamFoundation.TFStringComparer' from assembly 'Microsoft.TeamFoundation.Common, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

Any help would be appreciated

Sowndarya
  • 97
  • 1
  • 15
Shalem
  • 1,446
  • 2
  • 22
  • 47
  • Where is the DLL it's referencing? You checked you're not using an old bin or GAC reference? – Jeremy Thompson Jun 23 '17 at 09:03
  • 1
    placed the dll in bin – Shalem Jun 23 '17 at 09:05
  • A re-install like @Patrick (or better upgrade) suggested is probably going to be the fastest way to solve this and provide a gaurentee that you'll start off on the right foot and won't run into further issues. I'd be interested to know if you use ILSpy if the type even exists in the DLL? Surely it does in the Nuget package which then points to a permission or corruption issue. – Jeremy Thompson Jun 23 '17 at 09:12
  • Did you use Nuget package manager? You should be referencing from the package folder not the bin folder – Jeremy Thompson Jun 23 '17 at 09:14
  • Does referencing path(package folder/bin folder) make difference? – Shalem Jun 23 '17 at 12:11
  • Yes, you probably have the old DLL... – Jeremy Thompson Jun 24 '17 at 03:14
  • @Jeremy Thompson - I've referenced the dll from package folder. It dint make any difference. Same error exists – Shalem Jun 28 '17 at 07:04

2 Answers2

10

I've tried Microsoft Team Foundation Server Extended Client instead of Microsoft Team Foundation Server Client. This resolved my error. Thanks @Patrick-MSFT, you provided me thoughts to resolve the issue

Shalem
  • 1,446
  • 2
  • 22
  • 47
1

Base on error info, the solution is installing and refer the necessary assemblies Microsoft.TeamFoundation.Common, Version=15.0.0.0.

You can install nugget Package Microsoft.TeamFoundation.Client. After installed this Package, you can use this reference in the code.

Another workaround is copying the necessary assemblies from another machine. If the issue still persist, please re-install the VS 2017. More details please take a look at this similar question.

PatrickLu-MSFT
  • 49,478
  • 5
  • 35
  • 62
  • 2
    Installed the nugget Package and refered **Microsoft.TeamFoundation.Common** in the code. Same error exists. Let me try re-installation of VS2015 – Shalem Jun 23 '17 at 08:27
  • 1
    I've re-installed VS2015 as suggested. Error exists. Do we have any alternate to resolve the issue? Please help/suggest – Shalem Jun 28 '17 at 06:30