“The calling thread must be STA, because many UI components require this” error when creating a WPF pop-up Window in thread

For the thread that you’re trying to start the GUI element in, you need to set the apartment state of the thread to STA BEFORE you start it.

Example:

myThread.SetApartmentState(ApartmentState.STA);
myThread.Start();

Leave a Comment