Registering .NET Components with COM
ArcGIS SDK  

Registering .NET Components with COM

Extending the ArcGIS applications with custom .NET components requires registering the components in the COM registry and exporting the .NET assemblies to a type library (tlb). When developing a component, there are two ways to perform this task: you can use the RegAsm utility that ships with the .NET Framework SDK or Visual Studio.NET, which has a Register for COM Interop compiler flag.

The example below shows an EditTools assembly being register with COM. The /tlb parameter specifies that a type library should also be generated, and the /codebase option indicates that the path to the assembly should be included in the registry settings. Both of these parameters are required when extending the ArcGIS applications with .NET components.

regasm EditTools.dll /tlb:EditTools.tlb /codebase

Visual Studio.NET performs this same operation automatically if you set the Register for COM Interop compiler flag; this is the simplest way to perform the registration on a development machine. To check a project's settings, click Project Properties from the Project menu, then look at the Build property under Configuration Properties. The last item, Register for COM Interop, should be set to True.