c# - MSTest refuses to run 64-bit? -


i writing tests application using outlook redemption absolutely must run 64-bit (it connects windows mapi , outlook x64). unfortunately, cannot life of me make run test in 64-bit. have tried using .runsettings file (edited indicate 64-bit) , .testsettings file (also edited), , have selected test>testsettings>default processor architecture>64-bit, no avail.

every time, system.environment.is64bitprocess false, , when load dll connect outlook , mapi dreaded com exception: wrong os or os version application (exception hresult: 0x800401fa (co_e_wrongosforapp)) indicates 64-bit outlook installed , process trying access 32-bit.

i have restarted vs 2012 after making settings changes have read somewhere restart may necessary. have other suggestions? could write console app runs informal tests , reports status, next step these tests integrated automated build. appreciated.

edit

screenshot of host settings page in .testsettings enter image description here

experiment

interestingly, did little experiment. created new solution single console app project. put public method in there returned true. when ran console app, , paused execution, looked , indeed running 64-bit; no problem there. added test project, created single test called method. added var is64 = environment.is64bitprocess , put breakpoint after it.

predictably, without changing options, is64 false. chose 64-bit default architecture dropdown under test, cleaned solution, , ran test again, same result, running 32-bit. restarted vs2012, cleaned, built, same result. created testsettings file , referenced in test menu, clean build, same, restart,clean, build same. created runsettings file, set <targetplatform>x64</targetplatform> , referenced in test menu, ran through again, , came same results. qtagent32.exe continues run process, , absolutely refuses heed demands run 64 bit.

i swear, if have delete qtagent32.exe , rename qtagent name, will. not above cramming wishes down computers throat when wants obstinate. please, if dont want see me mistreat workstation, show me going wrong. think of computers.

if use vs2012, able select platform x64 through test settings below;

enter image description here

in example referring .runsettings file. settings

enter image description here

but if wish run test through command line need use vstest.console.exe instead of mstest doesn't support x64 test.dlls

you find vstest.console.exe @ "c:\program files (x86)\common7\ide\commonextensions\microsoft\testwindow\"

please note below steps

  1. open cmd
  2. navigate "c:\program files (x86)\common7\ide\commonextensions\microsoft\testwindow\"
  3. execute vstest.console.exe "c:\projects\test\test.automation.specs.dll" /inisolation /platform:x64

note : test.automation.specs.dll test project , need define full path

i hope help


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -