Search code examples
.netjenkinsvisual-studio-2013msbuildmicrosoft-fakes

MSBuild failing due to missing Fakes


We recently upgraded to Jenkins 2.60.1 and now our ci build for our .NET application is failing due to missing Microsoft Fakes assemblies:

ApiControllerUnitTest.cs(20,30): error CS0234: The type or namespace name 'Fakes' does not exist in the namespace 'Domain' (are you missing an assembly reference?) [e:\jenkins\workspace\proj\ci\Web\Web.Test\Web.Test.csproj] ApiControllerUnitTest.cs(31,21): error CS0234: The type or namespace name 'QualityTools' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)

Further up the build I noticed the following warnings:

23>C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1697,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Domain.Fakes". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [e:\jenkins\workspace\proj\ci\Web\Domain.Test\Domain.Test.csproj]

Our last successful build had the following in the log:

25>BuildFakesAssemblies: Domain.Fakes -- e:\jenkins\workspace\proj\ci\Web\Domain.Test\FakesAssemblies\Domain.Fakes.dll

Our latest build after the upgrade no longer executes the BuildFakesAssemblies task within MSBuild, which makes sense why the assemblies are missing because they aren't being created via this task. Nothing changed in this project either between the last successful build and the current failing build.

I did log onto our build server and noticed that our license for VS Studio 2013 Premium has expired. I know you need either Premium or Ultimate to take advantage of Fakes, but I wasn't sure if this was needed on a build server where MSBuild is being executed from the command line via Jenkins on that box. Has anyone encountered this error or know if you need a valid licensed installation of VS Studio on your build server to compile Fakes assemblies?


Solution

  • Our admin just added in a temporary license and now our build works again.

    In summary, it looks like you need to have an instance of VS Studio Premium 2013 or Ultimate 2013 on the build server with a valid license in order to have MSBuild build Fakes assemblies.

    Seems silly to have to install VS Studio when running MSBuild from the command line, but that is the only way it seems to work for us.