Erik Schierboom
Erik Schierboom

Reputation: 16656

Resharper 6.1 test runner throws BadImageFormatException

After upgrading Resharper to version 6.1, when I try to run my unit tests using the Resharper test runner I get a pop-up dialog that complains about the test assembly having a BadImageFormatException. How do I get Resharper to run my unit tests?

Upvotes: 2

Views: 1985

Answers (2)

Markus
Markus

Reputation: 3353

Use a testsettings file in your solution to specify the test architecture. This can be added using Visual Studios "Add Item" from the context menu. In the new file Specify "Run tests in 64 bit process on 64 bit machine" in the Hosts section.

For detailed information refer to Microsoft's documentation.

Upvotes: 0

Erik Schierboom
Erik Schierboom

Reputation: 16656

The problem is that the Resharper test runner expects the test assembly to have the same image format as the test runner itself. The test runner is an x86 application, so this problem can occur when your test assembly is an x64 assembly. The solution is therefore simple: change your test assembly's project properties to build in x86 format. For more details, see this url: http://www.justjuzzy.com/2012/01/resharper-6-1-unit-test-runner-failed-to-load-test-assembly/

Upvotes: 11

Related Questions