I'm setting up a CI with TeamCity 8 (v8.1.4).

I finally managed to setup TFS integration - ie checkout from TFS. I used the super easy Auto Detect Build Steps [thank you JetBrains for that] to determine the Build Steps necessary.

I used the Get missing NuGet packages step, which works as expected.

Then I have a Visual Studio Solution build step, that seems to build great, just until the point where it wants to build the Unit Test and Integration Test projects, which both use Microsoft Fakes. Here I can see that TeamCity tries to search everywhere for the [AssemblyNameUnderTest].Fakes.dll - where [AssemblyNameUnderTest] is whatever dll that is tested.

I haven't included that dll to my project nor in TFS, since I thought that it would be regenerated each and every time I change something to the original AssemblyNameUnderTest (ClassLibrary) Project. Should I include the [AssemblyNameUnderTest].Fakes.dlls to the project and TFS or am I right that they are regenerated ? And if I'm right with the regeneration, then why TeamCity can't find it ?

Thanks in advance,



2 Answers


Ah, so I found the answer to one of my questions: http://hamidshahid.blogspot.be/2012/11/microsoft-fakes-framework.html

The files in the "Fakes" folder are only generated at the time of adding the fakes assembly. They are added to the solution and should be checked into source control.

The "FakesAssemblies" folder and all the files in it are generated whenever the project is compiled. This is important because if you are adding fakes for assembly for a changing component, the generation of FakesAssemblies will ensure that all changes are reflected in the generated assembly.

So I did that - ie it is the default behaviour. Above that my .fakes files have the "Fakes" build action, but it still isn't working for TeamCity.

Also, TeamCity uses the MSBuild.EXE from "C:\Program Files (x86)\MSBuild\12.0\Bin" for the build.

Anyone a bright idea ?


To fix the build, I removed the Fakes stuff and implemented Moq mocks. Seems to give you more control of what exactly happens.