Can you please tell what is accomplished by decorating a C-Sharp Main Subroutine withÃÂ MTAThread vs. STAThread.
I have read couple C-Sharp Multithreading books, but I did not find any explanation of applicability of STAThread or MTAThread in C sharp code.
Why are such attributes needed in a C-sharp code in the first place ?
I had a Console Application where its Main was decoratedÃÂ with STAThread by default. Everything worked without problem. Then I addedÃÂ aÃÂ WCF service, which services a separate GUI Client application.ÃÂ When I use the GUI, my Console application gives a ContextSwitchDeadlock error. The only way I canÃÂ get rid of the error is by marking the MAIN MTAThread. But I do not why the error goes away.ÃÂ
Also, My Console Application does use a COM Based service, but I do not know if that has a bearing on this problem or not.
View Complete Post