<PreferComInsteadOfManagedRemoting> Element
Specifies whether the runtime will use COM interop instead of remoting for all calls across application domain boundaries.
<configuration>
<runtime>
<PreferComInsteadOfManagedRemoting>
<PreferComInsteadOfManagedRemoting enabled="true|false"/>
The following sections describe attributes, child elements, and parent elements.
Attribute | Description |
---|---|
enabled |
Required attribute. Indicates whether the runtime will use COM interop instead of remoting across application domain boundaries. |
Value | Description |
---|---|
false |
The runtime will use remoting across application domain boundaries. This is the default. |
true |
The runtime will use COM interop across application domain boundaries. |
None.
Element | Description |
---|---|
configuration |
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. |
When you set the enabled
attribute to true
, the runtime behaves as follows:
The runtime does not call IUnknown::QueryInterface for an IManagedObject interface when an IUnknown interface enters the domain through a COM interface. Instead, it constructs a Runtime Callable Wrapper (RCW) around the object.
The runtime returns E_NOINTERFACE when it receives a
QueryInterface
call for an IManagedObject interface for any COM Callable Wrapper (CCW) that has been created in this domain.
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.
The following example shows how to specify that the runtime should use COM interop across isolation boundaries:
<configuration>
<runtime>
<PreferComInsteadOfManagedRemoting enabled="true"/>
</runtime>
</configuration>
.NET feedback
.NET is an open source project. Select a link to provide feedback: