Profile Picture

Error when closing Live System

Posted By gbulle 9 Years Ago
Posted Tuesday May 05 2009

When I try to stop the Live System just after "return true" of Disconnect() function

of broker plugin  I see this error:

System.CannotUnloadAppDomainException: Error while unloading appdomain. (Exception from HRESULT: 0x80131015)
   at System.AppDomain.Unload(AppDomain domain)
   at RightEdge.Shared.TradingModuleWrapper.UnloadDomain()
   at RightEdge.Shared.TradingModuleWrapper.Dispose()
   at RightEdge.LiveSystemwindow.<>c__DisplayClass1.<StopLiveSystem>b__0()
   at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
   at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
   at System.Threading.ExecutionContext.runTryCode(Object userData)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
   at System.Windows.Forms.Control.InvokeMarshaledCallbacks()

Can you please explain better this error probably caused by a DLL's of mine but I do not know why (my DLL's works fine..... but probably they corrupt something)




Edited: Tuesday May 05 2009 by gbulle
Posted Wednesday May 06 2009
Most likely your DLL is doing something which is preventing the AppDomain from being unloaded.  Are you still using the native FIX dll, or did you create a service proxy?

Some information about what might be causing this problem from here:

This type of exception does happen when you are stuck inside unmanaged code which performs an uninterruptable blocking operation. Waiting for a native socket select would be such a case. If your Dll does cause socket connections make sure you close them before they your unload your AppDomain.


Posted Wednesday May 06 2009

my broker plugin communicates with my proxy by named pipes;

At connect I run a thread listening for named pipe messages arriving from proxy; may be  this thread is running when I try to disconnect.....

I will try to stop the thread directly into disconnect... I will let you know...



Similar Topics

Reading This Topic

2005-2018 © RightEdge Systems