Scope of Publication

Different remoting systems have different ways of deciding which members and what type of members can be used remotely. .NET remoting exposes objects to other application domains as though they were local, with the following exceptions:

  • Static members.

    Static fields and methods are never remoted, and field access is through direct memory. That is, .NET remoting always deals with instance members of some form.

  • Instance fields and accessors.

    For instance fields and accessor methods, the system inserts a check at run time to determine whether the object is a proxy. If it is not a proxy, field access is direct. Otherwise, the proxy provides accessors to the caller.

  • Private methods.

    Private methods cannot be remoted. You cannot wrap and pass a delegate to a private method remotely.

  • Delegates.

    Delegates are marshal-by-value objects. The object within the delegate can be any type of remotable object — a serializable object, a MarshalByRefObject object, or a ContextBoundObject object. The sole exception is that a delegate to an interface method cannot be successfully remoted. The delegate will wrap the implementation of the interface method, requiring the type information of the client to be available to the server.

  • Overriding methods on Object.

    For performance reasons, the virtual methods on Object methods always execute locally in the application domain where they are called. Calls to any of the following methods will go only to the remote object when these methods have been overridden on the remote object:

    • Equals

      This virtual method executes remotely if overridden.

    • GetHashCode

      This method executes locally.

    • ToString

      This virtual method executes remotely if overridden.

    • Equals (the static version)

      This method executes locally.

    • MemberwiseClone

      This method executes locally.

See Also

Remotable and Nonremotable Objects | MarshalByRefObject | ContextBoundObject | Object