Need a work around Microsoft.QualityTools.Testing.Fakes
Solution 1
I was getting a similar issue some time back. Re-referencing the test assembly and recreating the Fakes assembly sorted the issue for me.
Solution 2
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
Solution 3
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.
Solution 4
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>
Related videos on Youtube
TechLiam
Updated on June 04, 2022Comments
-
TechLiam almost 2 years
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
-
TechLiam over 9 yearsThanks this seamed to fix it i'm very gratful had spent about 3 hours fighting though many other ways that just did not work
-
SarjanWebDev almost 9 yearsYou saved my n number of hours! Thanks.
-
Rich over 5 yearsThe 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.