System.Runtime.Remoting 命名空间

System.Runtime.Remoting 命名空间提供允许开发人员创建和配置分布式应用程序的类和接口。 The System.Runtime.Remoting namespace provides classes and interfaces that allow developers to create and configure distributed applications. System.Runtime.Remoting 命名空间更重要的一些类为 RemotingConfiguration 类、RemotingServices 类和 ObjRef 类。 Some of the more important classes of the System.Runtime.Remoting namespace are the RemotingConfiguration class, the RemotingServices class, and the ObjRef class.


将在客户端注册的对象类型的值保存为可以在服务器上激活的类型。Holds values for an object type registered on the client end as a type that can be activated on the server.


将在服务端注册的对象类型的值保存为可以应客户端请求激活的类型。Holds values for an object type registered on the service end as one that can be activated on request from a client.


定义供 .NET Framework 远程处理基础结构使用的实用工具方法。Defines utility methods for use by the .NET Framework remoting infrastructure.


包装按值封送对象引用,从而使它们可以通过间接寻址返回。Wraps marshal-by-value object references, allowing them to be returned through an indirection.


存储生成代理以与远程对象通信所需的所有相关信息。Stores all relevant information required to generate a proxy in order to communicate with a remote object.


提供多种配置远程处理结构的静态方法。Provides various static methods for configuring the remoting infrastructure.


在远程处理过程中出现错误时引发的异常。The exception that is thrown when something has gone wrong during remoting.


提供多种使用和发布远程对象及代理的方法。Provides several methods for using and publishing remoted objects and proxies. 此类不能被继承。This class cannot be inherited.


在以前指定的某个时期内无法到达服务器或客户端时引发的异常。The exception that is thrown when the server or the client cannot be reached for a previously specified period of time.


当客户端连接到无法引发异常的非 .NET Framework 应用程序时,则引发该异常,以向客户端传达错误。The exception that is thrown to communicate errors to the client when the client connects to non-.NET Framework applications that cannot throw exceptions.


提供若干使用和发布 SOAP 格式的远程对象的方法。Provides several methods for using and publishing remoted objects in SOAP format.


实现保存用来激活远程类型实例的配置信息的基类。Implements a base class that holds the configuration information used to activate an instance of a remote type.


将在客户端注册的对象类型的值保存为服务器激活类型(单个调用或 singleton)。Holds values for an object type registered on the client as a server-activated type (single call or singleton).


将在服务端注册的对象类型的值保存为服务器激活类型对象(单个调用或 singleton)。Holds values for an object type registered on the service end as a server-activated type object (single call or singleton).



提供与 ObjRef 一起传送的自定义信道信息。Provides custom channel information that is carried along with the ObjRef.


提供代表信息。Provides envoy information.


定义用于从间接寻址打开按值封送对象的接口。Defines the interface for unwrapping marshal-by-value objects from indirection.


提供对象的类型信息。Provides type information for an object.



指定如何处理自定义错误。Specifies how custom errors are handled.


定义如何激活已知对象。Defines how well-known objects are activated.


RemotingConfiguration类包含与配置设置进行连接的静态方法。The RemotingConfiguration class contains static methods for interfacing with configuration settings. RemotingConfiguration.Configure方法允许开发人员若要配置远程处理基础结构通过使用 XML 格式的配置文件。The RemotingConfiguration.Configure method allows developers to configure the remoting infrastructure through the use of XML formatted configuration files. RemotingConfiguration类还包含几种方法的客户端的客户端和服务器端注册和激活的服务器对象驻留在服务器上。The RemotingConfiguration class also contains several methods for client-end and server-end registration of client and server activated objects that reside on the server.

RemotingServices类提供了多种方法,以帮助进行使用和发布远程对象。The RemotingServices class provides a number of methods to help in using and publishing remoted objects. RemotingServices.Marshal方法提供了有关将激活和与中的一个实例的远程对象通信所需的所有相关信息存储功能ObjRef类进行序列化和传输到远程位置的更高版本。The RemotingServices.Marshal method provides the functionality for storing all the relevant information required to activate and communicate with a remote object in an instance of the ObjRef class for later serialization and transmission to a remote location. RemotingServices.Unmarshal方法可反转此过程中,创建可由应用程序而不考虑任何远程处理分支的远程对象的代理。The RemotingServices.Unmarshal method reverses this process, creating a proxy for a remote object that can be used by an application without regard for any remoting subdivisions.

ObjRef类承载激活和与远程对象通信所需的所有相关信息。The ObjRef class holds all the relevant information required to activate and communicate with a remote object. 此类是传输到远程位置使用的通道将被取消封送的对象的可序列化表示形式 (请参阅Unmarshal) 和可用于创建远程连接对象的本地代理。This class is a serializable representation of an object that is transmitted to a remote location using a channel, where it is unmarshaled (see Unmarshal) and can be used to create a local proxy of the remoted object.


由引用封送对象 (Mbr) 不驻留在内存中。Marshal-by-reference objects (MBRs) do not reside in memory forever. 相反,除非该类型重写MarshalByRefObject.InitializeLifetimeService若要控制其自己的生存期策略,每个 MBR 都有有限的生存时间之前的.NET Framework 远程处理系统开始删除并回收内存的过程。Instead, unless the type overrides MarshalByRefObject.InitializeLifetimeService to control its own lifetime policies, each MBR has a finite lifetime before the .NET Framework remoting system begins the process of deleting it and reclaiming the memory. 有关详细信息,请参阅生存期租约For more information, see Lifetime Leases.