we have been developing our application (based on COM objects and runnning
under COM+) for about 10 years. The functionality of applications includes
using jScript engine, which runs code developed by our customer. Because we
have to avoid reentrancy in STA apartments, we use COM+ registry flag
EmulateMTSBehavior=1 (that works OK).
Recently we have decided to improve the functionality of application with
the possibility of running .NET code. We use CLR hosting (interfaces
ICorRuntimeHost, _AppDomain) and we create special application domain for
running .NET code. Everything works fine with one exception. When executing
.NET code (or making callback from .net code) sometimes happens that new
inbound call
to COM+ is processed on the same thread (reentrant call in STA is made).
We need to know, how to avoid this behavior.