System Namespace
Indicates that the default threading model for an application is single-threaded apartment ( STA ).
Threading models only pertain to applications that use COM interop. Applying this attribute to an application that does not use COM interop has no effect.
The startup threading model can be set to single-threaded apartment or multithreaded apartment. If it is not set, then the thread is not initialized.
This attribute has the same effect as setting in the System.Threading.ApartmentState property of a System.Threading.Thread. Apply this attribute, rather than set the ApartmentState property, to ensure the threading model is set before any startup code is executed.
Apply this attribute to the main method of an application.
MTAThreadAttribute