This help center has been deprecated and moved to a new address, please follow this link to open an active help center.

Thank you and sorry for inconvenience!



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.
Have more questions? Submit a request

Comments

  • Avatar
    Brian Knight

    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

  • Avatar
    Russ Harding

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

  • Avatar
    Alexander Kurakin

    ReSharper will have .runsettings support in 9.0 version http://youtrack.jetbrains.com/issue/RSRP-336300

  • Avatar
    Russ Harding

    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.

  • Avatar
    Alexander Kurakin

    Russ, this is for ReSharper + Visual Studio.

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

Powered by Zendesk