Why could COM interop layer be 40 times slower when client is compiled in VS 2010 vs VS 2005?

It was kind of a long shot. Glad I could help.

Matching MTA vs STA (threading model) is really important when making lots of distinct calls into any COM object. An [STAThread] directive at the top of a method is one way to be sure of threading model for every call in that method.

Looks like Thread.SetApartmentState(ApartmentState.STA) will work for a whole thread, but not apparently for thread pool threads.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)