How to run MSTest tests using x64 configuration

You wrote some tests using MSTest for x64 architecture and they pass if you run them via Visual Studio test runner. But when you run them via ReSharper, you get this error even if you "force tests to run in 64-bit process" here ReSharper | Options | Tools | Unit Testing:

System.BadImageFormatException: Could not load file or assembly {some dll name} or one of its dependencies. An attempt was made to load a program with an incorrect format. 

 

The solution is the following: 

  1. Set up .testsettings file (Open .testsettings | Hosts | Run Tests in 64 bit process on 64 bit machine) 
  2. Point ReSharper to use it via ReSharper | Options | Unit Testing | MSTest | Select Test Run Configuration | Use this Test Run Configuration.
5 comments

This is ok if you are using VS2012, but VS 2013 no longer supports test settings files, so what should be used in then with R#8.2

0

Any follow up to this? I am having this issue constantly with VS2013 and TC 8.1.3

0

Is this for VS or for TeamCity?  I'm vastly more concerned for TeamCity since, as a developer, I may run a set of unit tests for my piece of a project; but as a Project owner/Development manager I want to see the build server run all the unit tests for the whole project.  Its the TeamCity piece that have me the most concerned.

0

Russ, this is for ReSharper + Visual Studio.

For TeamCity, please contact TeamCity team directly teamcity-feedback@jetbrains.com regarding this matter. 

0

Please sign in to leave a comment.

Have more questions?

Submit a request