locked
VS2013 test project problem: WaitAll for multiple handles on a STA thread is not supported RRS feed

  • Question

  • Hi. With VS2013 Ultimate Update 4. A TestMethod execution fails with: “System.NotSupportedException: WaitAll for multiple handles on a STA thread is not supported.”

    I want to use the new VS2013 testing framework execution engine, not the VS2010's engine.

    Question: How can I configure my VS2013 TestMethods to execute with MTA apartment?

    Thank you very much in advance.


    Friday, December 12, 2014 4:20 AM

Answers

All replies

  • Hi MarcoDorantes,

    So it worked well in VS2010 with the Test Settings file:

    <Execution>
         <ExecutionThread apartmentState="MTA" />
    </Execution>
    

    It doesn't work in VS2013, am I right? I doubt that it has this limitation using the above workaround from VS2012 and VS2013.

    Reference:

    http://ralessi.wordpress.com/2013/09/11/mta-testing-on-vs2012/

    https://devtipsandtricks.wordpress.com/2013/07/06/how-to-run-unit-test-in-mta-mode/

    To get the issue confirmed and diagnose by product team, would you please create connect report for it? You will get email notification for update from product team experts .http://connect.microsoft.com/VisualStudio/feedback/CreateFeedback.aspx

    If you submit it, please share me the link here, I will help you vote it.

    Note: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you.

    Microsoft does not control these sites and has not tested any software or information found on these sites;

    Therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there.

    There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

    Sincerely,Jack


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, December 12, 2014 9:33 AM
  • Saturday, December 13, 2014 11:34 AM
  • Vote it:)

    Have a nice day,

    Jack


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, December 15, 2014 2:32 AM
  • Hi Jack. Just to let you know that there is a response in the Connect link.

    Best regards.

    Tuesday, December 16, 2014 2:12 PM
  • As a side note, for the design task at hand, I have resolved the reported issue using the System.Threading.CountdownEvent class for thread signaling.

    Tuesday, December 16, 2014 5:00 PM
  • I am afraid the CountdownEvent class worked partially: it avoids the reported issue, but I need kind of a AutoResetCountdownEvent class. Do you know something like that?

    Tuesday, December 16, 2014 6:31 PM
  • I wrote an AutoResetCountdownEvent class based on a reference count and an AutoResetEvent. So far, it worked not as a general-purpose class but just for my particular task at hand. Thank you.



    Tuesday, December 16, 2014 11:15 PM