← Back to team overview

nunit-core team mailing list archive

Re: [Question #202776]: how to globally enforce of STA in NUnit 2.6 ?

 

Question #202776 on NUnit Framework changed:
https://answers.launchpad.net/nunit-3.0/+question/202776

    Status: Open => Answered

Charlie Poole proposed the following answer:
The "standard" approach would be to use an assembly-level
RequiresSTAAttribute to run under the STA. You could put the attribute
in a separate file to be included in the project with all the
generated files.

An alternative - assuming you use the console runner - is to use the
/apartment=STA option on the command line.

For the gui runner, a quick feature request might get the change into
NUnit 2.6.1, which just dropped it's RC.

Charlie

On Tue, Jul 10, 2012 at 2:35 PM, Piotr Dudała
<question202776@xxxxxxxxxxxxxxxxxxxxx> wrote:
> New question #202776 on NUnit Framework:
> https://answers.launchpad.net/nunit-3.0/+question/202776
>
> Hello,
>
> Is there any way that allows global enforement of STA in NUnit 2.6  ?
>
> I recently read that NUnit no longer recognizes settings regarding Single/Multiple Thread Apartment  from configuration files.
> Presently I'm working on what I think is pretty common setup (C#, NUnit,SpecFlow,Selenium2 and hundreds of scenarios spread among few sepearate projects in one solution.). I have chosen NUnit mainly because of standalone runner. After conversion from Microsoft Test Framework and subsequent upgrade to NUnit 2.6 standalone runner reports error in every scenario, saying basically that tests should run in STA mode. File,where it complains about it are all generated by SpecFlow which can hardly be pressed to put additional attributes in it's generated code...
>
> Could someone suggest a way to remedy this, as I'd like to leave this test suite to be a bit more future-proof, not bound to 2.5.x line... ?
>
> Best Regards,
> Piotr
>
>
>
>
> --
> You received this question notification because you are a member of
> NUnit Core Developers, which is an answer contact for NUnit Framework.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~nunit-core
> Post to     : nunit-core@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~nunit-core
> More help   : https://help.launchpad.net/ListHelp

-- 
You received this question notification because you are a member of
NUnit Core Developers, which is an answer contact for NUnit Framework.