I expect this is a pretty obscure problem that not many of you will run into, but here it is if only so that I can remember it next time. We have some code that has to run x86, even on x64 platforms, so our assemblies are marked as x86. This extends to the unit tests otherwise they wont run. Unfortunately, when the unit test runner runs them, it fails with BadImageFormatException.
The solution is to use corflags.exe to force Jetbrains.Resharper.TaskRunner.exe to run in x86 mode:
coreflags /32BIT+ Jetbrains.Resharper.TaskRunner.exe
Of course, this will now run all tests as x86, even on x64 platforms, which may not be what you want.