6

We been getting this on are most up to date systems VS 12 update 4 we have tried setting specific version to false and still get the test failing with this message

Product.Business.Test.Providers.AuthenticationProvider.GivenRequestToStoreAuthenticationState_WhenParametersAreValid.ThenItShouldStoreTheAuthenticationState threw exception: System.IO.FileLoadException: Could not load file or assembly 'Microsoft.QualityTools.Testing.Fakes, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

can anybody save us from this fake calamity

david.s
  • 11,283
  • 6
  • 50
  • 82
TechLiam
  • 137
  • 1
  • 3
  • 10

4 Answers4

7

This solved it for me:

  • deleting the bin, obj and FakesAssemblies folder
  • make sure the specific version for the Microsoft.QualityTools.Testing.Fakes assembly is set to 'false'
  • rebuild the test project
Stef Heyenrath
  • 9,335
  • 12
  • 66
  • 121
4

I was getting a similar issue some time back. Re-referencing the test assembly and recreating the Fakes assembly sorted the issue for me.

sethidev
  • 111
  • 5
2

After days of fighting this problem in TFS Build, I discovered it is really a runtime error when the unit tests are run by TFS. The key is "or one of its dependencies." The

Microsoft.QualityTools.Testing.Fakes.dll

is dependent on

Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll

so I copied the framework DLL into the Fakes directory and checked it in. That solved the problem.

zx485
  • 28,498
  • 28
  • 50
  • 59
PeteFratus
  • 21
  • 2
1

Adding the below entry in App.config worked for me.

<runtime> 
  <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
   <dependentAssembly> 
     <assemblyIdentity name="Microsoft.QualityTools.Testing.Fakes" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/> <bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0"/> 
    </dependentAssembly> 
   </assemblyBinding> 
</runtime>
bummi
  • 27,123
  • 14
  • 62
  • 101
  • The project that was giving me trouble had that entry in the app.config, only the newVersion which was supposed to be 12.0.0.0 was set to 11.0.0.0 causing half my tests to fail. – Rich Jan 15 '19 at 22:22