BadImageFormatException running NUnit build step

I just upgraded to TeamCity 7.1 and I'm liking the new features so far.

We currently run our tests under Gallio with an MSBuild target, but I noticed that the built-in dotCover support doesn't work unless the tests run under a TeamCity test build step.

So I created a new build step to run my NUnit tests after compiling. The tests are split across several .NET 4.0 assemblies, some are compiled 32BIT+, some are compiled AnyCPU.
I had assumed that I would need to choose Platform: auto (MSIL), but when I do, I get the following for 32BIT+ assemblies:

[Step 2/2] NUnit error running tests in 'Test.dll' assebmly (sic)
Loading assembly is compiled for v4.0.30319, x86
NUnit runner runtime is v4.0.30319, x64
System.BadImageFormatException: Could not load file or assembly 'Test, Version=10.3.1.0, Culture=neutral, PublicKeyToken=3835f10dbe79083f' or one of its dependencies. An attempt was made to load a program with an incorrect format.

If I force the Plaform to be x86, the error goes away, but now my AnyCPU tests don't run native x64.

Is this to be expected? Must I separate 32-bit and AnyCPU test assemblies into two separate build steps?

1 comment
Comment actions Permalink

is there a solution for this? I am experiencing a similar problem.

0

Please sign in to leave a comment.