System.Runtime.CompilerServices.RequiredAttributeAttribute Class

Specifies that an importing compiler must fully understand the semantics of a type definition, or refuse to use it. This class cannot be inherited.

See Also: RequiredAttributeAttribute Members

Syntax

[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.All, AllowMultiple=true, Inherited=false)]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class RequiredAttributeAttribute : Attribute

Remarks

You can apply this attribute to classes, structures, enumerations, and interfaces.

For example, you can use this attribute to mark a C++ class that has a copy constructor. Any compiler that uses such a class must understand every constraint on its use, such as never creating an object of that class in the garbage collected heap, because a relocation does not call its copy constructor.

The classes in System.Runtime.CompilerServices are for compiler writers use only.

Requirements

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