Bug in taskrunner mixing x86/AnyCPU assemblies

We ran into a problem with the resharper testrunner when using assemblies compiled in x86 mode.

To reproduce:
* Create assembly A with single class C doing simple thing M
* Create test assembly A.Tests testing A.C.M.
* Run tests
Exp and act: Works
* Select Configuration manager and build A in x86
* Rerun tests
Exp: Works
Act: System.BadImageFormatException : Could not load file or assembly 'A, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.

The workaround in the simple case is to set A.Tests to build in x86 mode too.

--Jesper Högström

4 comments
Comment actions Permalink

Hello Jesper
     Which unit testing framework and which version of ReSharper are you using? Thank you!

Andrey Serebryansky

Senior Support Engineer

JetBrains, Inc

http://www.jetbrains.com

"Develop with pleasure!"

0
Comment actions Permalink

Sorry about that omission.

I use Re# 6.1.37.86 and nunit 2.5.10 provided with re#.

--Jesper

0
Comment actions Permalink

Hi Jesper,

this is intended behavior. ReSharper choose in which configuration to run tests based on test assembly configuration.

I assume you are running x64 OS, and in this case Any CPU assemblies are run in x64 mode. If you want tests to run in x86 mode, it sounds reasonable to have test assembly in x86 configuration too.

0
Comment actions Permalink

I understand that it makes sense :)

If the state could be detected before execution, or a friendlier message displayed it would be nice.

--Jesper

0

Please sign in to leave a comment.