System.Runtime.InteropServices.ComUnregisterFunctionAttribute Class

Specifies the method to call when you unregister an assembly for use from COM; this allows for the execution of user-written code during the unregistration process.

See Also: ComUnregisterFunctionAttribute Members

Syntax

[System.AttributeUsage(System.AttributeTargets.Method, Inherited=false)]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class ComUnregisterFunctionAttribute : Attribute

Remarks

You can apply this attribute to methods.

System.Runtime.InteropServices.ComUnregisterFunctionAttribute enables you to add code that reverses the operations performed by a registration method. If you apply the System.Runtime.InteropServices.ComRegisterFunctionAttribute to provide a registration method, you must also provide an unregistration method to reverse the operations done in the registration method. You can have only one unregistration method for a class.

The common language runtime calls the method with this attribute when its containing assembly is unregistered (directly or indirectly) with the [<topic://cpgrfassemblyregistrationtoolregasmexe>] or through the RegistrationServices.UnregisterAssembly(System.Reflection.Assembly) API method. Methods with this attribute can have any visibility (public, private, and so on), but must be static and must take a single Type parameter for the Type to unregister.

Requirements

Namespace: System.Runtime.InteropServices
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0