Documentation

Documentation
V5 Documentation

MSTest Thread Apartment State

Project-level NCrunch configuration setting Default Value: STA
ID/Tag in config file: MSTestThreadApartmentState

Purpose

This setting controls the apartment state of the thread used to execute tests held within the applicable project, when using the MSTest test framework.

Because the apartment state of MSTest's execution thread is usually controlled with the .testsettings file (which is not supported by NCrunch), this setting provides a way to continue to run tests that can only operate with an MTA thread.

Recommendations

As the default apartment state for MSTest is STA, you generally won't need to change this setting unless you have legacy tests that make use of a .testsettings file to run as MTA.

This setting is applicable only to MSTest. To control the apartment state of tests for other test frameworks, instead use attributes that are specific to these frameworks.

Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download