LogicalCallContext is working great in most situations but I'm having
problems calling remote objects through reflection. They work and return the
proper values but the remote CallContext never has the values I placed in
them. Here's an example:

//==========================
//MethodInfo mi, Type t, object[] param and string uri are all passed in

//MyLogicalData implements ILogicalThreadAffinitive
CallContext.SetData("__MyLogicalData", MyLogicalData);

//create the TransparentProxy
object tp = RemotingServices.Connect(t, uri);

//call the remote method
object retVal = mi.Invoke(tp, param);
//===========================

This works as expected, the remote method is called and the retVal is valid.
However, MyLogicalData is never passed to the remote object even though it
exists locally. I tested calling a remote object directly (without
reflection) and MyLogicalData was passed.

Any thoughts here? Is the MethodInfo.Invoke call somehow forgeting to add
the CallContext values to the IMessage?

thanks
brian

You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced 
DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to