when we use STAThread in the Main, does it mean we cannot create new thread from Main?
when we use STAThread in the Main , does it mean we cannot create
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No, it doesn’t. Most UI applications start in an STA thread – it doesn’t stop them from starting new threads.
STAThreadis mostly about COM interop. I’ve found you can mostly ignore it when you’re not using anything that uses COM – but be aware that UI controls which interact with the clipboard etc may well use COM.Note that the attribute just affects the apartment model for the newly created thread which runs the application. It’s got very little to do with the
Mainmethod itself, really – it could have been an assembly attribute, or something like that instead.