locked
MSTest: running unit tests in 64 bit mode RRS feed

  • Question

  • Hi All,

    I can successfully run tests inside VS2012 in 64 bit mode using the following settings:

    Run tests in 64-bit

    But I still cannot do it on the build server. The error I get is:

    Unable to load the test container '...\Tests\UnitTesting\bin\Release\UnitTesting.dll' or one of its dependencies. If you build your test project assembly as a 64 bit assembly, it cannot be loaded. When you build your test project assembly, select "Any CPU" for the platform. To run your tests in 64 bit mode on a 64 bit processor, you must change your test settings in the Hosts tab to run your tests in a 32 bit process. Error details: Could not load file or assembly 'file:///...\Tests\UnitTesting\bin\Release\UnitTesting.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format.

    I compiled the UnitTesting DLL as AnyCPU and added the following line to the Local.TestSettings file:

    <Execution hostProcessPlatform="MSIL">


    What else should I check?

    Thanks,

    Alberto


    • Edited by devDept Tuesday, September 10, 2013 3:00 PM
    Tuesday, September 10, 2013 2:59 PM

Answers

All replies

  • Hi Alberto,

    As far as I know, it has this limitation in default, since the MSTest.exe is a 32 bit process.

    Reference

    Run MSTest.exe as a native 64-bit process

    Edwer shared us more information about this issue here:

    Question on 64bit testing

    Best Regards,


    Jack Zhai[MSFT]
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support
    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Wednesday, September 11, 2013 9:38 AM
  • I still had a reference in my VStudio project to a x64 DLL, recompiling it as AnyCPU they started to work!

    Alberto

    Wednesday, September 11, 2013 11:49 AM