Show/Hide Toolbars

XSharp

The COM page in the Add Reference dialog lists the COM components that were found in the registry on your machine.

You can select a component from this list.

 

However, these components cannot be consumed directly by the X# compiler. Therefore Visual Studio calls a tool (tlbimp.exe) that reads the typelibrary from the COM component and produces a managed wrapper around this COM object. This wrapper usually has a name that starts with "interop". In the Email example this is the case for the Internet Explorer component for which a Interop.SHDocVw.dll is generated.

If the COM component is an ActiveX then a second assembly will be generated that has code that declares an object that inherits from System.Windows.Forms.AxHost, for the ActiveX control. Visual Stdio calls the tool "aximp.exe" for this. The file names for these wrappers usually start with "axinterop", such as "AxInterop.SHDocVw.dll"

Some COM components are used a lot and for these components a so called "Primary Interop Assembly" is installed on your machines. For these components no "interop" assemblies will be generated but the primary interop assemblies will be used when compiling. For example for ADO there is a primary interop assembly in the GAC.

 

COM references 1