Re: UserControls and Nunit
| Newsgroups | gmane.comp.windows.dotnet.nunit.user |
|---|---|
| Message-ID | <[email protected]> |
Much obliged, Charlie! I was close; just needed to make a copy of the config with the correct name and now I can test successfully from GUI, command-line, and from VS (via TestDriven plug-in). Charlie Poole writes: > Hi Michael, > >> From the NUnit GUI most of my tests run fine, except for a >> series of tests on one user control. The error it reports is: >> >> System.Threading.ThreadStateException : Current thread must >> be set to single thread apartment (STA) mode before OLE calls >> can be made. Ensure that your Main function has >> STAThreadAttribute marked on it. >> >> I found information on adding some constructs to my .NET >> config file which allows me to run from the command-line >> (nunit-console) successfully. But this does not help running >> from the NUnit GUI. >> >> Is there something one could add to the xxx.nunit config file to help? >> My configuration: >> NUnit 2.4.7 >> C# >> .NET 2.0 >> VS2008 > > See http://nunit.org/?p=configFiles&r=2.4.7 which shows how to > set the config so the tests all run in the STA. > > Charlie > >> Note that this problem is similar to an earlier one, to which >> there was unfortunately no reply: >> > http://sourceforge.net/mailarchive/message.php?msg_id=A6D531D8-53D9-4942-A69 > 5-15675CBFDF71%40abacalab.com >> >> ~~Michael Sorens ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone