Run MSTest.exe as a native 64-bit process.


If you need to run MS Test command line utility as a 64-bit process you need to do 2 things:

Disclaimer: Be aware that this is not supported and it is under you own risk.

1. Backup the MSTest.exe file first and then remove the 32-bit flag by running the CorFlags.exe utility as:

    CorFlags.exe MSTest.exe /32BIT- /Force

2. Run your test with /noisolation switch to run tests within the MSTest.exe process and avoid using 32-bit only VSTestHost.exe

   MSTest.exe /testcontainer:<your assembly> /resultsfile:results.trx /noisolation

And optionally, if MSTest.exe fails because the 32-bit flag was modified, you may want to skip the strong name verification:

reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\MSTest,b03f5f7f11d50a3a /f

Comments (4)

  1. Akhilesh Joshi says:

    Does Visual Studio 2010 support 64 bit mstest.exe officially?

  2. Pradeep B says:

    I tried adding the registry key.

    Still it fails for the same "strong name verification" reason.

    I am running Windows 7 x64. Please help.

  3. Gurn Blanston says:

    In Visual Studio 2013 you can set the architecture under the Test menu somewhere and it works without any of these kluges.