NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

ComUnregisterFunctionAttribute Class

Use this attribute on a method to indicate that the method should be called when the assembly is unregistered for use from COM. This allows user written code to be executed during the unregistraton process. Methods with this attrubte must be static and must take a single string parameter for the name of the registry key being updated. If and when the assembly containing the method is unregistered with the RegAsm tool, this method is called by the runtime. If the assembly containing the method is not unregistered. the method is not called. If the types within the assembly were not intented to be used from com, the assembly will typically not be registered. The registry key being updated such as "HKEY_CLASSES_ROOT\CLSID\<clsid>" is passed to the method. Each assembly can have only one unregistration function, at most.

If a unregistration method is provided, it should be sure to "undo" when the registration function did.

Object
   Attribute
      ComUnregisterFunctionAttribute

[Visual Basic]
Public Class ComUnregisterFunctionAttribute
   Inherits Attribute
[C#]
public class ComUnregisterFunctionAttribute : Attribute
[C++]
public __gc class ComUnregisterFunctionAttribute : public Attribute
[JScript]
public class ComUnregisterFunctionAttribute extends Attribute

Remarks

Can be used to attribute assemblies.

Requirements

Namespace: System.Runtime.InteropServices

Assembly: mscorlib.dll

See Also

ComUnregisterFunctionAttribute Members | System.Runtime.InteropServices Namespace