Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MS Fakes unit tests failing after Visual Studio 2013 Update 4

I have recently upgrade from Microsoft Visual Studio 2013 Update 3 (Premium edition) to Microsoft Visual Studio 2013 Update 4 (Premium edition) and now my existing unit test projects have stopped compiling. It fails with the error:

The type 'Microsoft.QualityTools.Testing.Fakes.Stubs.StubBase`1' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.QualityTools.Testing.Fakes, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

We, along with a lot of other people, had a similar issue where a bug was introduced in VS2013 that could be resolved by manually deleting the .messages file (via File Explorer or solution explorer with view all files enabled) inside FakesAssemblies folder inside the project folder. This however doesnt fix the issue, even if I delete the entire FakesAssemblies folder.

The reference to the project (including correct version is their within the project). I have deleted the reference and readded it and it has no effect, they still fail to compile.

The unit test projects still compile and pass on other colleagues machines with Visual Studio 2013 Update 3.

New projects unit test projects using MS fakes also fail to build.

So short of, uninstalling the Update 4 is there anything else I can try?

If not I'll log a bug on Microsoft Connect.

like image 518
Kyle Avatar asked Nov 14 '14 16:11

Kyle


2 Answers

In the reference properties for Microsoft.QualityTools.Testing.Fakes, change "Specific Version" property to FALSE. Doing so will allow Visual Studio 2013 to use whatever version of Microsoft.QualityTools.Testing.Fakes is installed on your machine.

With Visual Studio 2013 Update 4, Microsoft incremented the version number of Microsoft.QualityTools.Testing.Fakes.dll from 11.0 to 12.0; this is what caused things to break.

like image 141
The Chiller Avatar answered Nov 06 '22 23:11

The Chiller


  1. the fix was to remove all references ending with .FAKES (including the Microsoft.QualityTools.Testing.Fakes.dll reference).
  2. I also removed the FAKES folder
  3. Cleaned solution
  4. Then readded all references back in.

We had some further errors to do with Shims but we just converted these to Stubs.

We had to upgrade all our projects this way manually, all VS instances including the build server.

like image 23
Kyle Avatar answered Nov 06 '22 23:11

Kyle