No doubt that ReSharper’s test runner (for running unittests) clearly outranks the test runner in Visual Studio 2010.   So to my big disappointment I was not able to make projects targeted for 64-bit (actually a project using a 64-bit assembly) work together with ReSharpers test runner (using ReSharper 6.1).

Searching the web didn’t give me any solutions.  I found a post, where Jetbrains stated it had been fixed, though I couldn’t get it to work.

The problem is very simple.  I had an assembly (AnyCPU) that referenced another assembly (64-bit).   When running the unittest it just failed with a:  BadImageFormatException when loading the 64-bit assembly.  This clearly indicates, that the test runner loads as 32-bit instead of 64-bit.

So my little hack is a low-level hack and not very elegant:

  1. Open the Windows Explorer and go to your Resharper installation folder (e.g C:\Program Files (x86)\JetBrains\ReSharper\v6.1\Bin
  2. Locate the file: JetBrains.ReSharper.TaskRunner.CLR4.exe and make a copy of it
  3. Locate the file: JetBrains.ReSharper.TaskRunner.CLR4.x64.exe and make a copy of it
  4. Then rename the file: JetBrains.ReSharper.TaskRunner.CLR4.x64.exe to JetBrains.ReSharper.TaskRunner.CLR4.exe

That’s it …