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 an Interop.SHDocVw.dll is generated.

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

For the COM components that are used a lot,  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