How to run MSTest in 64-bit mode?


My code references some native DLLs that require 64-bit. When I run those using Rider UI, I get this error:

Assembly Initialization method MyTests.TestSuiteInitializer.AssemblyInitialize threw exception. System.BadImageFormatException: System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B). Aborting test execution.

The MSTest settings UI shows no option to run in 64-bit (see below). Is there any configuration file or trick that can make Rider run the test in 64-bit mode? Of course, I need the entire integration working - status of each test method, ability to cancel, etc.

1 comment


In the Unit Tests window there is a Session option button where you can specify the platform, as you can notice on the screenshot below:

Could you please try specifying the required platform here and let me know if that helps?


Please sign in to leave a comment.