TeamCity NUnit winner fails due to x86 - x64 - MSIL inconsistencies

I have a solution with a bunch of projects, some of which also have test projects. All of them are compiled for the platform Any CPU.

In TeamCity, I have a build configuration for NUnit 2.6.4, which I point to Platform: auto (MSIL)and Version: 4.0.

When I run the build, the tests fail with the following message:

NUnit error running tests in 'C:\BuildAgent\work\a58fc6cd9bf63032\JsonApi.Tests\obj\Release\JsonApi.Tests.dll' assembly
Loading assembly is compiled for v4.0.30319, MSIL
NUnit runner runtime is v4.0.30319, x64

Even a stranger, when I just turned off "run failed tests first" (and changed nothing), I got the following:

NUnit error running tests in 'C:\BuildAgent\work\a58fc6cd9bf63032\JsonApi.Owin.Tests\obj\Release\JsonApi.Owin.Tests.dll' assembly
Loading assembly is compiled for v4.0.30319, MSIL
NUnit runner runtime is v4.0.30319, x86

Note that in one case, the runner is x86, and in the other, x64. In any case, they successfully load the assembly compiled for MSIL.

I assume something is disabled with my build settings here, but what?

+4
1

, , :

...  
System.IO.FileNotFoundException: Could not load file or assembly 'System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 or one of its dependencies.  
The system cannot find the file specified.  
File name: 'System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35|'  

Server stack trace:  
    at System.Reflection.RuntimeAssembly.GetExportedTypes(RuntimeAssembly assembly, ObjectHandleOnStack retTypes)  
    at System.Reflection.RuntimeAssembly.GetExportedTypes()  
    at NUnit.Core.CoreExtensions.InstallAdhocExtensions(Assembly assembly)  
    at NUnit.Core.Builders.TestAssemblyBuilder.Load(String path)  
    at NUnit.Core.Builders.TestAssemblyBuilder.Build(String assemblyName, Boolean autoSuites)  
    at NUnit.Core.Builders.TestAssemblyBuilder.Build(String assemblyName, String testName, Boolean autoSuites)  
    at NUnit.Core.TestSuiteBuilder.Build(TestPackage package)  
    at NUnit.Core.SimpleTestRunner.Load(TestPackage package)  
    at NUnit.Core.ProxyTestRunner.Load(TestPackage package)  
    at NUnit.Core.ProxyTestRunner.Load(TestPackage package)  
    at NUnit.Core.RemoteTestRunner.Load(TestPackage package)  
    at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object|[|] args, Object server, Object|[|]& outArgs)  
    at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)  
...  

, - , SO-, , .. obj, bin. , NUnit.

, , . - :

**\bin\**\*.Tests.dll

" :". , obj , . SO.

+7

All Articles