Limitations
- Events of the generated interfaces are connected through the sink classes rather than through events of the COM interfaces as
with TlbImp (
app.WorkbookOpen += ...), because C# has no extension events;dynamicobjects support+=for the events of dispinterfaces. - By default COM objects cannot be released manually: the generated interfaces, the late-bound wrappers and the
dynamicobjects share one wrapper per COM object, whose references are released when it is garbage collected, andComObject.FinalRelease()of .NET only releases unique wrappers, whichCreate(unique: true)and theuniquemarshaller ofSetMarshallingcreate;dynamicobjects, and the objects inVARIANTs andSAFEARRAYs are always shared. Finalizers do not run when the process exits, and an out-of-process server such as an Office application only exits afterQuit()once all its objects are released, not only the application object: let them go out of scope and callGC.Collect()andGC.WaitForPendingFinalizers().ComBstr,ComSafeArray<T>and the event sinks are disposable and are released at once. - Structures keep the layout of the COM structures, so
VARIANT,SAFEARRAYand interface pointer members are raw values, andBSTRmembers areComBstrValueviews that the code using the structure allocates and frees; onlyDATE,CURRENCYandVARIANT_BOOLmembers are converted. SAFEARRAYs are converted to zero-based .NET arrays of up to three dimensions, andT[,]/T[,,]require a known rank; onlyComSafeArray<T>keeps their bounds and supports more dimensions.- The types used from other type libraries are generated into the project, in the namespaces of their libraries; referencing other interop assemblies that contain them is not supported yet.
- Interop assemblies lack the documentation, the functions of modules and some type information of their type libraries, see Interop assemblies.
The issues that are known and not fixed, with the reasons why, are listed in Known issues.