What are the difference between serialize and marshalbyref and marshalbyval?How will you load dynamic assembly?How will create assembilies at runtime ?If you have more than one version of one assemblies then how'll you use old version in your application?How ccw and rcw work?What is MTS. Explain it?

Showing Answers 1 - 3 of 3 Answers

No. The idea of MarshalByRefObject is that it doesn't every get serialized for remoting purposes. Instead the CLR generates what is known as a transparent proxy in this scenario. It's called Transparent because it looks and acts just like ClassA but in reality is not actually ClassA. All calls into an instance of ClassA are marshalled accross the remoting boundaries into the original AppDomain where ClassA was created.

EDIT: Responding to further clarification.

When passing data to a MarshalByRefObject in this scenario you need to consider what type the data is. Essentially derives from MarshalByRefObject or it doesn't. If it does derive from MarshalByRefObject then the parameter will be passed as a proxy. If it doesn't derive from MarshalByRefObject then it will be serialized, passed across the AppDomain boundary as a series of bytes and then deseriazied in the target AppDomain.

Your scenario listed strings which are not MarshalByRef (usually I refer to these as MarshalByValue but that's purely convention). So they will be serialized when passed across your remoting boundary.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions