Specifies the method to call when you register an assembly for use from COM; this enables the execution of user-written code during the registration process.
See Also: ComRegisterFunctionAttribute Members
You can apply this attribute to methods.
System.Runtime.InteropServices.ComRegisterFunctionAttribute enables you to add arbitrary registration code to accommodate the requirements of COM clients. For example, you can update the registry using registration functions from the Microsoft.Win32 namespace. If you provide a registration method, you must also apply System.Runtime.InteropServices.ComUnregisterFunctionAttribute to an unregistration method, which reverses the operations done in the registration method.
The common language runtime calls the method with this attribute when its containing assembly is registered (directly or indirectly) with the [<topic://cpgrfassemblyregistrationtoolregasmexe>]or through the RegistrationServices.RegisterAssembly(System.Reflection.Assembly, AssemblyRegistrationFlags) method.
This attribute can be applied only to methods that have the following characteristics: