Name

STAThreadAttribute

Synopsis

This attribute can only be used on the Main method of an application. It sets the default threading model to STA (single-threaded apartment). Alternatively, you can use the MTAThreadAttribute attribute to use a multithreaded apartment model.

Like its counterpart, MTAThreadAttribute, this attribute has no meaning outside of COM interoperability.

public sealed class STAThreadAttribute : Attribute {
// Public Constructors
   public method STAThreadAttribute();  
}

Hierarchy

ObjectAttributeSTAThreadAttribute

Valid On

Method

Get C# in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.