DisconnectedContext was detected

bjwade62

Well-known member
Joined
May 25, 2006
Messages
50
Programming Experience
3-5
I'm really new to .NET and am trying to convert some of my VB6 apps. I'm using a COM component. I'm getting the following error at runtime. Can anyone explain it to me in layman's turns and suggest a fix? Thanks!


DisconnectedContext was detected
Message: Context 0x1a07a8' is disconnected. Releasing the interfaces from the current context (context 0x1a0358).This may cause corruption or data loss. To avoid this problem, please ensure that all contexts/apartments stay alive until the applicationis completely done with the RuntimeCallableWrappers that represent COM components that liveinside them.
 
Originally posted by MSDN
The DisconnectedContext managed debugging assistant (MDA) is activated when the CLR attempts to transition into a disconnected apartment or context while servicing a request concerning a COM object.


So basically, say you have an STA (Single Threaded Apartment) You have to ensure that this thread stays alive until the all the objects have been properly disposed of.
 
Back
Top