System.Runtime.InteropServices.GuidAttribute Class

Supplies an explicit Guid when an automatic GUID is undesirable.

See Also: GuidAttribute Members


[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate | System.AttributeTargets.All, Inherited=false)]
public sealed class GuidAttribute : Attribute


You can apply this attribute to assemblies, interfaces, classes, enumerations, structures, or delegates, although the [<topic://cpgrfTypeLibraryImporterTlbimpexe>] can apply it for you when it imports a type library.

The string passed to the attribute must be in a format that is an acceptable constructor argument for the type Guid. To avoid conflicts with the type Guid, use the long name System.Runtime.InteropServices.GuidAttribute explicitly. Only use an explicit GUID when a type must have a specific GUID. If the attribute is omitted, a GUID is assigned automatically.


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