When I use some 3rd party library. If I forgot to specify STAThread, the code will fail mysteriously, I want to know why?
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.
Nothing mysterious. Because the COM library is written in a wa that requires all incoming threads to be STA. Like all UI components – STA has been the UI threading model since dinniosaurs smashed the first windows back in the flintstone age.