Unable to load x64 unit tests in VS2010 test project RRS feed

  • Question

  • Hello all,

    I am trying to write unit tests for one of my x64 project.

    For that I am taking steps as follows:

    1. Create a MSTest project in VS2010. Change it to x64 platform through "configuration manager".
    2. Link x64 binary of module under test. properties->Linker->Input->Additioanl Dependencies.
    3. Change Test Settings to "Run tests in 64 bit process on 64 bit machine".
    a) Test->Edit Test Settings->Local ->Hosts
    b) Test->Edit Test Settings->Trace and Test Impact ->Hosts
    4. Build test project and go to "Test View".
    Build is successful but while running test cases;
    Following error occurs:

    Error loading D:\Knoesis\Output\Bin\Debug\\UnitTests_VS2010_x64_GG.dll: Unable to load the test container 'D:\Knoesis\Output\Bin\Debug\\UnitTests_VS2010_x64_GG.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:///D:\Knoesis\Output\Bin\Debug\UnitTests_VS2010_x64_GG.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format.

    I was exploring this on internet and could found a proper reason so far.
    However, I doubt since my installed VS2010 is x86, x64 test runner is unavailable. (en_visual_studio_2010_ultimate_x86_dvd_509116.iso)

    Please help me, if you have any idea on this OR can guide me proper reference??

    Please help me on this?

    Monday, February 11, 2013 2:15 PM