'System.STAThreadAttribute' and 'System.MTAThreadAttribute' cannot both be applied to the same method

The System.STAThreadAttribute and System.MTAThreadAttribute attributes are mutually exclusive.

Error ID: BC31512

To correct this error

  • Apply either System.MTAThreadAttribute or System.STAThreadAttribute, but not both.

See Also

Reference

STAThreadAttribute

MTAThreadAttribute

Other Resources

Attributes in Visual Basic