Export (0) Print
Expand All

DirtyCastAndCallOnInterface 

The DirtyCastAndCallOnInterface managed debugging assistant (MDA) is activated when an early-bound call through a vtable is attempted on a class interface that has been marked late-bound only.

An application throws an access violation or has unexpected behavior when placing an early-bound call via COM into the CLR.

Code is attempting an early-bound call through a vtable via a class interface that is late-bound only. Note that by default class interfaces are identified as being late-bound only. They can also be identified as late-bound with the ClassInterfaceAttribute attribute with an AutoDispatch value ([ClassInterface(ClassInterfaceType.AutoDispatch)]).

The recommended resolution is to define an explicit interface for use by COM and have the COM clients call through this interface instead of through the automatically generated class interface. Alternatively, the call from COM can be transformed into a late-bound call via IDispatch.

Finally, it is possible to identify the class as AutoDual ([ClassInterface(ClassInterfaceType.AutoDual)]) to allow early bound calls to be placed from COM; however, using AutoDual is strongly discouraged because of the versioning limitations described in ClassInterfaceAttribute.

This MDA has no effect on the CLR. It only reports data about early-bound calls on late-bound interfaces.

The name of the method or name of the field being accessed early-bound.

<mdaConfig>
  <assistants>
    <dirtyCastAndCallOnInterface />
  </assistants>
</mdaConfig>

Community Additions

ADD
Show:
© 2014 Microsoft