Partilhar via


Direct Remoting

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 a number of situations in which you will want to use the remoting infrastructure directly, especially in combination with extensions to the remoting infrastructure. For example, if you want to publish a particular object at a particular URL, you call RemotingServices.Marshal and pass the object, the Uniform Resource Identifier (URI) you want to use for that object, and optionally the Type that represents the type information that will be exposed to the client. At any time, you can revoke publication of that object by calling RemotingServices.Disconnect, passing the object reference. You can then republish the same object at another URI. You can easily use this method to publish an object that you completely control at all times.

If you want to obtain a reference to a remote object from a client, you can go through the registration routines or you can simply call RemotingServices.Connect to acquire a proxy to a server-activated object. For a simple example of this, see Remoting Example: Dynamic Publication.

See Also

Reference

RemotingServices.Marshal Method
RemotingServices.Connect Method

Concepts

Remoting Example: Dynamic Publication

Other Resources

CallContexts and Direct Remoting
Advanced Remoting