Reputation: 49289
I need to open a window on a new thread, and I'm wondering if I should mark the thread as STA or MTA? I know that threadpool threads run as MTA, but they're typically not associated with any UI elements. Do winforms windows need to run as STA?
Upvotes: 0
Views: 3328
Reputation: 1503
Take a look at the correct answer for this SO question, explains STA vs MTA very well.
I would recommend running it as STA if it is a winforms window regardless, otherwise you will run into undefined behavior territory even if you get it to compile.
Upvotes: 2