Alex Rivera | Logout

NUnit GUI Runner and Apartment State

Asked 2010-03-17T15:17:52.347
10

How do you set the apartment state in the NUnit GUI runner? I'm trying to run a single NUnit test with WatiN and I'm getting the message:

MyNamespace.LoginTests.CanLogin:
System.Threading.ThreadStateException : The CurrentThread needs to have it's ApartmentState set to ApartmentState.STA to be able to automate Internet Explorer.

Edit
Report

1 Answer

23

Starting with NUnit 2.5, use RequiresSTA attribute in your tests.

answered 2011-04-28T05:20:47.543

Your Answer