Home All Groups Group Topic Archive Search About

ArgumentNullException went passing remoted ManualResetEvent to WaitAny

Author
7 Feb 2007 1:46 PM
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)

Author
12 Feb 2007 3:41 PM
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
Author
13 Feb 2007 11:06 AM
Lee Chapman
On Feb 12, 3:41 pm, "Oliver Sturm" <oli***@sturmnet.org> wrote:
> 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
> --http://www.sturmnet.org/blog

Okay - thanks.

- Lee

AddThis Social Bookmark Button