TFS 2012 + VS 2013 + Microsoft Fakes Compilation (only during TFSBuild)

We use TFS 2012 (Update 3) and VS 2013 RC. We have a .sln file with two projects - the main project / assembly and the UnitTest project. The unit test project uses Microsoft Fakes. In Visual Studio (we use Premium), I can compile .sln and run the tests. In the build agent, I can use Visual Studio to compile and build .sln and run the tests. But when we put the queue in the assembly, he cannot build the UnitTest project, because he cannot find the assembly of fakes. It does not seem to create dynamic creation, as it did in Visual Studio. Usually in VS, a fake dll is created and placed in the FakeAssemblies folder. After the assembly fails, I can log in and see that he did not create the FakeAssemblies directory at all.

Error ... C: \ Windows \ Microsoft.NET \ Framework64 \ v4.0.30319 \ Microsoft.Common.targets (1605): This link could not be resolved. Could not find assembly "System.Web.Http.5.0.0.0.Fakes". Make sure the assembly exists on disk. If this link is required for your code, you may get compilation errors.

Our assembly uses the default template - and we chose .sln for the assembly (which has the main assembly and unit test project). Shouldn't UnitTest be included in this .sln? Is there any other way that UnitTest should be assembled during assembly?

Does anyone know why an assembly will not be created by creating a fake assembly dynamically, like Visual Studio?

Thanks!!!

+6
source share
1 answer

I had the same problem, but with TFS 2012 and VS 2012, and solved it by installing Visual Studio on TFS Server. Therefore, if you already installed VS there, this advice will not help you.

At first I tried to copy this assembly from a folder on my local computer to the same folder on the TFS server. It is located in c:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PublicAssemblies\Microsoft.QualityTools.Testing.Fakes.dll .

The problem was resolved, the test project was successfully built, but each test using fakes was not transferred. Excluded:

Microsoft.QualityTools.Testing.Fakes.UnitTestIsolation.UnitTestIsolationException: UnitTestIsolation failed to initialize. Please restart Visual Studio and repeat this test.

I did not have time and decided to take the second step and install Visual Studio in a TFS machine, and all the problems disappeared

+2
source

Source: https://habr.com/ru/post/954263/


All Articles