RemotingSurrogateSelector RemotingSurrogateSelector RemotingSurrogateSelector RemotingSurrogateSelector Class


Selects the remoting surrogate that can be used to serialize an object that derives from a MarshalByRefObject.

public ref class RemotingSurrogateSelector : System::Runtime::Serialization::ISurrogateSelector
public class RemotingSurrogateSelector : System.Runtime.Serialization.ISurrogateSelector
type RemotingSurrogateSelector = class
    interface ISurrogateSelector
Public Class RemotingSurrogateSelector
Implements ISurrogateSelector


A surrogate is an object that can handle the serialization requirements of an object. Remoting surrogates handle remoting serialization requirements of objects that derive from MarshalByRefObject. The RemotingSurrogateSelector manages registered surrogates for use by the BinaryFormatter and SoapFormatter.

During serialization for remoting purposes of a MarshalByRefObject, the remoting surrogate creates an ObjRef that contains all the relevant information required to activate and communicate with the remote object. The newly created ObjRef can then be sent to a remote location and used to create a proxy.


This class makes a link demand and an inheritance demand at the class level. A SecurityException is thrown when either the immediate caller or the derived class does not have infrastructure permission. For details about security demands, see Link Demands and Inheritance Demands.


RemotingSurrogateSelector() RemotingSurrogateSelector() RemotingSurrogateSelector() RemotingSurrogateSelector()

Initializes a new instance of the RemotingSurrogateSelector class.


Filter Filter Filter Filter

Gets or sets the MessageSurrogateFilter delegate for the current instance of the RemotingSurrogateSelector.


ChainSelector(ISurrogateSelector) ChainSelector(ISurrogateSelector) ChainSelector(ISurrogateSelector) ChainSelector(ISurrogateSelector)

Adds the specified ISurrogateSelector to the surrogate selector chain.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetNextSelector() GetNextSelector() GetNextSelector() GetNextSelector()

Returns the next ISurrogateSelector in the chain of surrogate selectors.

GetRootObject() GetRootObject() GetRootObject() GetRootObject()

Returns the object at the root of the object graph.

GetSurrogate(Type, StreamingContext, ISurrogateSelector) GetSurrogate(Type, StreamingContext, ISurrogateSelector) GetSurrogate(Type, StreamingContext, ISurrogateSelector) GetSurrogate(Type, StreamingContext, ISurrogateSelector)

Returns the appropriate surrogate for the given type in the given context.

GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
SetRootObject(Object) SetRootObject(Object) SetRootObject(Object) SetRootObject(Object)

Sets the object at the root of the object graph.

ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)
UseSoapFormat() UseSoapFormat() UseSoapFormat() UseSoapFormat()

Sets up the current surrogate selector to use the SOAP format.


for operating with infrastructure code. Demand value: InheritanceDemand; Permission Value: Infrastructure

Applies to

See also