Current thread must be set to single thread apartment
Posted on 2007-04-11
I converted a project to .net 2.0 from 1.1 using VS 2005.
When i'm running the compiled version, application is throwing this error message -
"DragDrop registration did not succeed. ---> System.Threading.ThreadStateException: Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttribute marked on it."
I checked and the Main() function is marked with [STAThread] attribute.
Really not sure why this error is happening. Any help?