Export (0) Print
Expand All

RequiredAttributeAttribute Class

Specifies that an importing compiler must fully understand the symantics of a type definition, or refuse to use it.

For a list of all members of this type, see RequiredAttributeAttribute Members.

System.Object
   System.Attribute
      System.Runtime.CompilerServices.RequiredAttributeAttribute

[Visual Basic]
<AttributeUsage(AttributeTargets.Class Or AttributeTargets.Struct _
   Or AttributeTargets.Enum Or AttributeTargets.Interface)>
<Serializable>
NotInheritable Public Class RequiredAttributeAttribute
   Inherits Attribute
[C#]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct |
   AttributeTargets.Enum | AttributeTargets.Interface)]
[Serializable]
public sealed class RequiredAttributeAttribute : Attribute
[C++]
[AttributeUsage(AttributeTargets::Class | AttributeTargets::Struct
   | AttributeTargets::Enum | AttributeTargets::Interface)]
[Serializable]
public __gc __sealed class RequiredAttributeAttribute : public
   Attribute
[JScript]
public
   AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct |
   AttributeTargets.Enum | AttributeTargets.Interface)
 Serializable
class RequiredAttributeAttribute extends Attribute

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

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 create an object of said 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

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: Mscorlib (in Mscorlib.dll)

See Also

RequiredAttributeAttribute Members | System.Runtime.CompilerServices Namespace

Show:
© 2014 Microsoft