How to change ReSharper unit test architecture to x64?

后端 未结 7 1560
温柔的废话
温柔的废话 2021-02-08 22:21

In VS2012, I resolved a BadImageException from running a unit test by going to: TEST-> TEST SETTINGS -> DEFAULT PROCESSOR ARCHITECTURE -> x64.

This works in the built in

7条回答
  •  清歌不尽
    2021-02-08 22:54

    We had a similar issue when trying to setup MSTEST for Sharepoint 2007 - it would keep running in x86 instead of x64. Instantiating SPSite kept saying "The Web application at http://server:port/ could not be found".

    Option 1 - Assign Proper Active TestSettings

    I started with replacing the EXEs suggested by @valentin-kuzub to confirm it would work - but then realized that we had the wrong Test Settings file active - there were (2) Local.testsettings and TraceAndTestImpact.testsettings. One of them was set to use x86 instead of targeting x64.

    Option 2 - Configure RunSettings

    Another option is switching from testSettings to runSettings and assigning TargetPlatform.

    
      
        
        
        x64
        
        Framework40
      
    

    Option 3 - Use Test Settings Default Architecture

    The last option (which you already tried) is in the XML comments from option #2 -> You can also change it from menu Test->Test Settings->Default Processor Architecture->x64.

    enter image description here

提交回复
热议问题