we have an .NET application which uses a COM dll, the ThreadingModel of this component is "Appartment"
The Application always hangs calling a COM interface method.
the DebugDiag analysis says the following
The finalizer thread is probably tring to release an instance of an STA COM component, and it is stuck waiting for the STA thread to become available. To resolve this problem, call Marshal.ReleaseComObject to clean up the references for all apartment-threaded COM components that you have used in your code deterministically (immediately), rather than waiting for the Finalizer Thread to do it at a later time.
in the recommendation section, it has recommended to change the threading model to "Both" which i did and was working fine, but this cannot be done as we have an UI and is not recommended as per our design.
any idea what changes in our .NET application code can fix this issue.
Stack trace there are two threads, 2 and 65 that are trying to call into the COM object which in on thread 45, i guess the STA thread call stack of thread 2
call stack of thread 65