Author Topic: Managed Debugging Assistant 'DisconnectedContext'  (Read 6462 times)

Knut Paulsen

  • EA User
  • **
  • Posts: 82
  • Karma: +1/-0
    • View Profile
Managed Debugging Assistant 'DisconnectedContext'
« on: October 03, 2014, 10:25:18 pm »
Hi guys,

I'm getting into a habit of running into problems every friday afternoon :-)

I wonder if any of you have ever seen this behavior before:
I am running a debug session in VS Express 2012 for Windows Desktop.
I have a pretty long running task of importing stuff into EA, and sometimes, not always, it stops. The code is within a try/catch block, but it appears not to be an exception that I can catch. I get a dialog box telling me something bad has happened, full content is copied below. Apparently a thread has stopped for some reason that I do not understand and it is not my main working thread. If I switch to my thread in the debugger the topmost frames on the call stack are just presented as '[External code]' and the first frame that is 'mine' is busy with this statement: foreach (EA.Package package in parent.Packages).

I do notice that the output window says a NullReferenceException occurred in my program, but the parent variable in my code line is NOT null and I have already imported dozens of packages and elements into it. So form what I can see, this NullReferenceException must occur inside Enterprise Architect code.

Any ideas?

Full error description from VS:
A first chance exception of type 'System.NullReferenceException' occurred in IREAWizard.exe
The thread '<No Name>' (0x221c8) has exited with code 0 (0x0).
Managed Debugging Assistant 'DisconnectedContext' has detected a problem in 'C:\My Projects\TOOLSBYKNUT\IREA\IREAWizard\bin\Debug\IREAWizard.vshost.exe'.
Additional Information:
Transition into COM context 0x874478 for this RuntimeCallableWrapper failed with the following error:
  System call failed. (Exception from HRESULT: 0x80010100 (RPC_E_SYS_CALL_FAILED)).

This is typically because the COM context 0x874478 where this RuntimeCallableWrapper was created has been disconnected
or it is busy doing something else.
Releasing the interfaces from the current COM context (COM context 0x874308).
This may cause corruption or data loss.
To avoid this problem, please ensure that all COM contexts/apartments/threads stay alive and are available for context transition,
until the application is completely done with the RuntimeCallableWrappers that represents COM components that live inside them.

Cheers
Knut

Knut Paulsen

  • EA User
  • **
  • Posts: 82
  • Karma: +1/-0
    • View Profile
Re: Managed Debugging Assistant 'DisconnectedConte
« Reply #1 on: October 03, 2014, 10:56:21 pm »
It happened again, but this time without the NullReferenceException, so apparently it has nothing to do with this problem.

The code line is inside a method that searches through an EA package for a package with a specific name and I do notice that the package I am looking for is the same one as the last time it failed, which indicates that it might be my fault :-)