Add this to the configuration for the test
<TestRunConfiguration ...>
...
<ExecutionThread apartmentState="MTA" />
</TestRunConfiguration>
To check the threading model used, add the following line to your test(s):
[TestMethod]
public void YourTest()
{
System.Diagnostics.Debug.WriteLine(System.Threading.Thread.CurrentThread.GetApartmentState().ToString());
// TODO: Add test logic here
}
No comments:
Post a Comment