How can I default VS Test Processor Architecture to x64?

后端 未结 3 497
忘了有多久
忘了有多久 2021-02-05 00:04

I depend on a mixed-mode assembly which is compiled for x64. Because I do not want warnings in my build, all of the projects in my solution target x64 directly--they are not An

3条回答
  •  攒了一身酷
    2021-02-05 00:20

    UPDATE FOR VS2015:

    To ensure your test projects run at x64 please do the following:

    • Select 'Build' and then 'Configuration Manager' from the toolbar
    • Set Platform to x64 for your test project
    • If x64 isn't present select 'New' and add x64. You can now select it

    Then...

    • Right-click your test project from the solution explorer and select 'Properties'

    • Select the 'Build' tab on the left

    • Change the Target Platform to x64

    Note that you might get BadImageFormatExceptions if you are targetting a different platform for your live project. For example if Project1 is x86 and your Project1Test is targetting x64 you will likely come across this issue. You'll need to make sure both are matching (or just select 'Any CPU').

提交回复
热议问题