locked
Unit test setting file.

    General discussion

  • Hi,

    I have multiple test projects under the same solution. One project needs 64 bit host process and coded ui does not work on 64 bit ptocess,it need's 32 bit host process. Now both are using the same setting file. Could you please suggest what should be the best solution to avoid this confusion.

    Sunday, March 11, 2012 5:13 PM

All replies

  • Hi ManishGupta3,

    Thank you for posting in the MSDN forum.

    We often do it like the following steps.

    In the .testsettings, under the "Hosts" tab the drop-down menu "Run tests in 32-bit or 64-bit process:" should be selected as follows:

    1). If the unit test is desired to be run as a 64-bit process, then select "Run tests in 64 bit process on 64 bit machine"

    2). When we running a coded UI test, select “Force tests to run in 32 bit process”.

    Best Regards,


    Jack Zhai [MSFT]
    MSDN Community Support | Feedback to us


    Tuesday, March 13, 2012 9:27 AM
    Moderator
  • Hi Jack,

    Thanks for the reply.With this method , I can't select all the test from test viewer and run it at once.So I need to select all API automation's and run it and then change it is the hosts file for coded ui tests and run it again. Doesn't seem good to me ?

    Can we change the host process programetically ?

    Tuesday, March 13, 2012 5:53 PM
  • Hi ManishGupta3,

    Glad to receive your reply.

    I did some research, but I didn't find the better solution for this issue, but you could submit the suggestions and ideas: http://visualstudio.uservoice.com/forums/121579-visual-studio. Microsoft engineers will evaluate them seriously, thanks for your understanding.

    Another workaround, we can use the MSTest to run the tests with two different testsettings, and we can use two bat files to run the two tests automatically.

    Have a nice day,


    Jack Zhai [MSFT]
    MSDN Community Support | Feedback to us

    Wednesday, March 14, 2012 10:08 AM
    Moderator
  • Hey Jack,

    Thanks for the reply.

    Suppose I run the test from MSTest and not from Visual studio , in a different machine, then the current Test settings file won't work reason being we have enlistment in the previous machine(and it has relative paths w.r.t enlistment) but we don't have it in the test machine.Do you have any suggestion on how to tackle this situation.

    Friday, March 16, 2012 2:10 AM
  • Hi ManishGupta3,

    Sorry for my delay.

    I try to open the test settings file with Notepad, and I find that the test settings are different when we change the Host with VS,

    If we select “Run tests in 64 bit process on 64 bit machine”, you will get this code:

    <Execution hostProcessPlatform="MSIL">

    Select “Force tests to run in 32 bit process”, it doesn’t have that code.

    So we could write a test setting file, and check it.

    Best Regards,


    Jack Zhai [MSFT]
    MSDN Community Support | Feedback to us

    Monday, March 19, 2012 9:37 AM
    Moderator