ArgumentNullException went passing remoted ManualResetEvent to WaitAny

L

Lee Chapman

Hi,

I'm creating a ManualResetEvent in one AppDomain and then passing it
to a second AppDomain. (WaitHandle derives from MarshalByRefObject.)

If I call WaitOne() on my wait handle's remoting proxy, it works just
fine. If I pass the proxy to WaitHandle.WaitAny(), however, I get an
ArgumentNullException (see below).

The ManualResetEvent is obviously remoting okay because WaitOne()
works. Does anyone know why I can't seemt to use the same object
reference in a call to WaitHandle.WaitAny()?

Thanks,
- Lee


System.ArgumentNullException: Value cannot be null.
Parameter name: info
at
System.IntPtr.System.Runtime.Serialization.ISerializable.GetObjectData(SerializationInfo
info, StreamingContext context)
at System.Threading.WaitHandle.WaitMultiple(WaitHandle[]
waitHandles, Int32 millisecondsTimeout, Boolean exitContext, Boolean
WaitAll)
at System.Threading.WaitHandle.WaitAny(WaitHandle[] waitHandles,
Int32 millisecondsTimeout, Boolean exitContext)
at System.Threading.WaitHandle.WaitAny(WaitHandle[] waitHandles)
at App.Smtp.RelayThread.Run(EventWaitHandle shutdownEvent) in
RelayThread.cs:line 43
at
System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr
md, Object[] args, Object server, Int32 methodPtr, Boolean
fExecuteInContext, Object[]& outArgs)
at
System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle
md, Object[] args, Object server, Int32 methodPtr, Boolean
fExecuteInContext, Object[]& outArgs)
at
System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage
msg, Int32 methodPtr, Boolean fExecuteInContext)
 
O

Oliver Sturm

Hello Lee,
Does anyone know why I can't seemt to use the same object
reference in a call to WaitHandle.WaitAny()?

No, sorry - there seems to be something rather weird going wrong with
serialization, judging from your stack trace. I'd suggest you might want
to post this to microsoft.public.dotnet.framework.remoting, in case some
expert can help with a reference to a known problem.


Oliver Sturm
 
L

Lee Chapman

Hello Lee,


No, sorry - there seems to be something rather weird going wrong with
serialization, judging from your stack trace. I'd suggest you might want
to post this to microsoft.public.dotnet.framework.remoting, in case some
expert can help with a reference to a known problem.

Oliver Sturm
--http://www.sturmnet.org/blog

Okay - thanks.

- Lee
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top