Disconnected Context MDA Error


I recently moved my plug-in files (the visual basic project, source code, solution etc. files) around ( actually I uninstalled and reinstalled dropbox, which is where they were stored), and am now getting the following error when debugging using Visual Studio 2010:

"DisconnectedContext was detected

Message: Transition into COM context 0x1df0238 for this RuntimeCallableWrapper failed with the following error: The object invoked has disconnected from its clients. (Exception from HRESULT: 0x80010108 (RPC_E_DISCONNECTED)).
This is typically because the COM context 0x1df0238 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 0x1df0180).

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."

It mostly seems to occur when I close Rhino - this used to just automatically end the debug session. It also sometimes occurs when I open a file whilst debugging. The plug-in seems to work otherwise, and it doesn’t crash Rhino or VS 2010.

I’m presuming I must have moved something to cause this issue, however I only moved the visual basic project, source code, solution etc. files, I didn’t (as far as I know) change or move any of the RhinoCommon files. I did find on opening the VS project file that RhinoCommon Reference Property Copy Local was set to true, so when I reinstalled the plug-in from Rhino-Tools-Options, I had to change this to false to get it to install. I don’t know if that’s related.

I’m afraid the error message is a bit above my understanding. Any ideas what I can do to fix this?

I am guessing this has more to do with your your plug-in is doing then with the fact your source code has been moved. RPC_E_DISCONNECTED errors occur when accessing COM/Interop components and DLLs. You might looking to this as you are trying to figure out what is wrong.

Hi Dale, thanks for your reply.

Are you able to elaborate on which elements of a program are likely to involve accessing interop components? I appreciate this is a very broad question - I apologise that at this point the topic is somewhat beyond my limited understanding of the development environment/APIs/SDKs etc.
However, my plug-in essentially consists of a number of bits that either: add objects to rhino; perform simple analyses on blocks of numbers; open windows forms, that then do either of the first two; or add object user data. From looking around the web I’m tempted to first point my finger at the windows forms sections. Then, given that I’ve then had this error come up on exit, load and save, my next guess would be the object user data section.

Any further thoughts?

Not really, as I have no idea what your plug-in does or what other components it references. The error is generic in that it would be caused by a multitude of things. Any chance at looking at the source? Feel free to email me directly if you’d like.

Thanks Dale, I have emailed you at your McNeel address.