Share via


MarshalByRefObject Class

Provides access to objects across application domain boundaries in applications that support remoting.

Namespace: System
Assembly: mscorlib (in mscorlib.dll)

Syntax

[SerializableAttribute]
public abstract class MarshalByRefObject

Remarks

An application domain is a partition in an operating system process; one or more applications reside in each such partition. Objects in the same application domain communicate with one another directly. Objects in different application domains communicate with one another either by transporting copies of objects across application domain boundaries or by using a proxy to exchange messages.

The MarshalByRefObject class is the base class for objects that communicate across application domain boundaries by exchanging messages through a proxy. Objects that do not inherit from the MarshalByRefObject class are implicitly marshaled by value instead. When a remote application references an object that is marshaled by value, a copy of that object is passed across application domain boundaries.

Applications access MarshalByRefObject objects directly within the boundaries of the local application domain. The first time an application in a remote application domain accesses a MarshalByRefObject object, a proxy is passed to the remote application. Subsequent calls on the proxy are marshaled back to the object that resides in the local application domain.

A type must inherit from the MarshalByRefObject class if that type is to be used across application domain boundaries. Also, you must not copy the state of a MarshalByRefObject object, because the members of the object are not usable outside the application domain in which they were created.

Version Information

Available in the .NET Micro Framework versions 2.0, 2.5, 3.0, 4.0, and 4.1.

See Also

Reference

MarshalByRefObject Members
System Namespace