How to run vstest.console.exe for Unit Test 64-bit platform
Locally it is achieved by setting the tests on Visual Studio to run on x64 as default process.
Test tab on VS > Test Settings > Default Process Architecture > x64
When using some DevOps tool, the platform can be specified in the script which runs the vstest.console.exe
In my case, I'm using Azure DevOps Build Definitions, so I set my VS Test task to
/platform:x64
through a parameter when running vstest.console.exe.
vstest.console.exe "C:\Project\bin\x64\Release\Project.UnitTests.dll" "C:\Project\bin\x64\Release\Project.UnitTests.dll" /platform:x64 /logger:trx
Once it was set, all x64 targeting Unit Tests dlls were being executed successfully.
Check if you have vstest.console.exe under C:\ Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Mi crosoft\TestWindow\
- from cmd go to the path where your projects dll are kept. i.e. cd C:\Users\krakhil\Desktop\Notes\Practice Codes\VerifyExe\VerifyExe\bin\Debug
Press Enter
Then write -> "C:\ Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Mi crosoft\TestWindow\vstest.console.exe" VerifyExe.dll
Where VerifyExe.dll is the project dll i want to execute.