我在探索由NUnit和Nant驅動的WatIN自動化框架。我曾在的ApartmentState的App.confignunit2任務,NAnt,Watin - ApartmentState STA錯誤
<NUnit>
<TestRunner>
<!-- WatiN can only host IE in STA mode -->
<add key="ApartmentState" value="STA"/>
</TestRunner>
</NUnit>
我還設置設置[的TestFixture,RequiresSTA在測試類。當我使用nunit-console testrunner或Nunit GUI runner時,這很好。
在惡性使用Nunit2亞軍拋出該異常
[nunit2]:[DEBUG]的CurrentThread需要有它的ApartmentState設置爲ApartmentState.STA能夠自動的Internet Explorer
如何解決方法這個問題?
感謝 積木
你嘗試[的TestFixture(的ApartmentState = ApartmentState.STA) 也看到https://groups.google.com/group/testdrivenusers/browse_thread/thread/0bbd753de17a8383/7edef951a8ca415b ?lnk = raot&fwc = 1&hl = km – 2012-01-12 03:19:44
他們都沒有工作:(。仍在調查。 – 2012-01-12 13:48:04