NCrunch Forum
»
General Support
»
Build/Test Issues
»
How can I force NCrunch to run tests in STA?
Rank: Newbie
Groups: Registered
Joined: 12/7/2012(UTC) Posts: 1 Location: Ukraine
|
I get this error System.InvalidOperationException : The calling thread must be STA, because many UI components require this. on show component
I know what this problem is and thus in my NUnit tests I use this configuration: <configSections> <sectionGroup name="NUnit"> <section name="TestRunner" type="System.Configuration.NameValueSectionHandler"/> </sectionGroup> </configSections>
<NUnit> <TestRunner> <add key="ApartmentState" value="STA" /> </TestRunner> </NUnit>
However looks like NCrunch ignores NUnit configuration and runs anyway in MTA.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 6/25/2012(UTC) Posts: 89 Location: China
Thanks: 23 times Was thanked: 19 time(s) in 18 post(s)
|
I got this error before when I use Resharper. The solution was add [STAThread] to the test method.
|
1 user thanked yanglee for this useful post.
|
|
|
NCrunch Forum
»
General Support
»
Build/Test Issues
»
How can I force NCrunch to run tests in STA?
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
YAF |
YAF © 2003-2011, Yet Another Forum.NETThis page was generated in 0.019 seconds.