<PreferComInsteadOfManagedRemoting > 元素<PreferComInsteadOfManagedRemoting> Element

指定是否在运行时将使用 COM 互操作而不是远程处理的所有调用跨应用程序域边界。Specifies whether the runtime will use COM interop instead of remoting for all calls across application domain boundaries.

<configuration><configuration>
<运行时 ><runtime>
<PreferComInsteadOfManagedRemoting><PreferComInsteadOfManagedRemoting>

语法Syntax

<PreferComInsteadOfManagedRemoting enabled="true|false"/>  

特性和元素Attributes and Elements

下列各节描述了特性、子元素和父元素。The following sections describe attributes, child elements, and parent elements.

特性Attributes

特性Attribute 描述Description
enabled 必需的特性。Required attribute.

指示是否在运行时将跨应用程序域边界而不是远程处理中使用 COM 互操作。Indicates whether the runtime will use COM interop instead of remoting across application domain boundaries.

enabled 特性enabled Attribute

Value 描述Description
false 在运行时将使用远程处理跨应用程序域边界。The runtime will use remoting across application domain boundaries. 这是默认设置。This is the default.
true 运行时将跨应用程序域边界使用 COM 互操作。The runtime will use COM interop across application domain boundaries.

子元素Child Elements

无。None.

父元素Parent Elements

元素Element 描述Description
configuration 公共语言运行时和 .NET Framework 应用程序所使用的每个配置文件中的根元素。The root element in every configuration file used by the common language runtime and .NET Framework applications.
runtime 包含有关程序集绑定和垃圾回收的信息。Contains information about assembly binding and garbage collection.

备注Remarks

当您将设置enabled属性为true,运行时的行为,如下所示:When you set the enabled attribute to true, the runtime behaves as follows:

请确保这两种行为,COM 上的所有调用之间的都接口的托管的对象跨应用程序域边界使用 COM 和 COM 互操作而不是远程处理。These two behaviors ensure that all calls over COM interfaces between managed objects across application domain boundaries use COM and COM interop instead of remoting.

示例Example

下面的示例演示如何指定运行时应使用 COM 互操作跨隔离边界:The following example shows how to specify that the runtime should use COM interop across isolation boundaries:

<configuration>  
  <runtime>  
    <PreferComInsteadOfManagedRemoting enabled="true"/>  
  </runtime>  
</configuration>  

请参阅See also