This documentation is archived and is not being maintained.

DiscardableAttribute Class

Marks a type definition as discardable.

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


[Visual Basic]
Public Class DiscardableAttribute
   Inherits Attribute
public class DiscardableAttribute : Attribute
public __gc class DiscardableAttribute : public Attribute
public class DiscardableAttribute 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.


A type definition might be marked discardable if it is not referenced by any other code in its assembly. This might be useful for languages that support separate compilation, where it is only at link phase that it becomes known whether any type is actually referenced by other code.

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


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

DiscardableAttribute Members | System.Runtime.CompilerServices Namespace