Share via


Activation of Remote Objects

This topic is specific to a legacy technology that is retained for backward compatibility with existing applications and is not recommended for new development. Distributed applications should now be developed using the  Windows Communication Foundation (WCF).

There are two types of activation for marshal-by-reference objects:

  • Server activation.

    Server-activated objects are created by the server only when they are needed. They are not created when the client proxy is created by calling new or Activator.GetObject, but rather when the client invokes the first method on the newly created proxy object. For details, see Server Activation.

    You use the WellKnownObjectMode enumeration to configure server-activated objects as Singleton or SingleCall objects. Singleton objects are objects for which there will always be only one instance, regardless of how many clients there are for that object, and which have a default lifetime. (The client can use the lifetime lease system to participate in the lifetime of Singleton instances. For details, see Lifetime Leases.) When you configure an object to be a SingleCall object, the system creates a new object for each client method invocation. Because a client will get a reference to a new instance on each invocation, SingleCall types do not participate in the lifetime lease system.

  • Client activation.

    Client-activated objects are created on the server when the client calls new or Activator.CreateInstance. The client itself, using the lifetime lease system, can participate in the lifetime of these instances. For details, see Client Activation and Lifetime Leases.

See Also

Tasks

How to: Create an Instance of a Client-Activated Type

Concepts

Server Activation
Client Activation

Other Resources

Object Activation and Lifetimes