<PreferComInsteadOfManagedRemoting > 元素<PreferComInsteadOfManagedRemoting> Element

指定執行時間是否會針對跨應用程式域界限的所有呼叫,使用 COM Interop 而不是遠端處理。Specifies whether the runtime will use COM interop instead of remoting for all calls across application domain boundaries.

<configuration> <configuration>
    <runtime >   <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 Interop,而不是跨應用程式域界限進行遠端處理。Indicates whether the runtime will use COM interop instead of remoting across application domain boundaries.

啟用屬性enabled Attribute

Value 描述Description
false 執行時間會跨應用程式域界限使用遠端功能。The runtime will use remoting across application domain boundaries. 這是預設值。This is the default.
true 執行時間會跨應用程式域界限使用 COM Interop。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:

這兩種行為可確保跨應用程式域界限的 managed 物件之間的所有呼叫都是使用 COM 和 COM Interop,而不是遠端處理。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 Interop: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