Strange Error - InvalidOperationException

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Anyone know what this error means?

The Undo operation encountered a context that is different from what was
applied in the corresponding Set operation. The possible cause is that a
context was Set on the thread and not reverted(undone).


It seems to pop up when I use nSoftware's IPDaemon...
 
Anyone know what this error means?

The Undo operation encountered a context that is different from what was
applied in the corresponding Set operation. The possible cause is that a
context was Set on the thread and not reverted(undone).

It seems to pop up when I usenSoftware'sIPDaemon...

Can you post the stacktrace?
 
Can you post the stacktrace?


Hi Lance,

Thanks for posting the 10035 Winsock Error code... we found the code on
your blog which allowed us to handle the Operation Would Block error.

In anycase, the InvalidOperationException seems to be the same problem
as seen here

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=173873&SiteID=1

Here is the StackTrace:

at System.Threading.SynchronizationContextSwitcher.Undo()
at System.Threading.ExecutionContextSwitcher.Undo()
at System.Threading.ExecutionContext.runFinallyCode(Object userData,
Boolean exceptionThrown)
at
System.Runtime.CompilerServices.RuntimeHelpers.ExecuteBackoutCodeHelper
(Object backoutCode, Object userData, Boolean exceptionThrown)
at
System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteed
Cleanup(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.Net.ContextAwareResult.Complete(IntPtr userToken)
at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result,
IntPtr userToken)
at
System.Net.Sockets.BaseOverlappedAsyncResult.CompletionPortCallback
(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback
(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)


As you see - it looks like a REALLY low level error.

My IPDaemon is hosted in a Windows Form. A reference to the Daemon is
passed to worker threads which handle each connection. InvokeThrough is
set to the Form. In order to get rid of the InvalidOperationException, I
had to invoke all calls to the daemon order to remove the error. I had
to treat IPDaemon like a graphic control - even tho it doesn't touch the
GUI at all. I'm worried that marshalling all calls through the GUI
thread will bottleneck the daemon...

Have you see this problem before?

I e-mailed IPWorks support and they said the Daemon is supposed to be
threadsafe?
 
Back
Top