Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Need a work around Microsoft.QualityTools.Testing.Fakes

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

like image 977
TechLiam Avatar asked Jan 02 '15 11:01

TechLiam


3 Answers

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
like image 77
Stef Heyenrath Avatar answered Nov 08 '22 21:11

Stef Heyenrath


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

like image 20
sethidev Avatar answered Nov 08 '22 22:11

sethidev


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.

like image 2
PeteFratus Avatar answered Nov 08 '22 22:11

PeteFratus