Επεξεργασία

Κοινή χρήση μέσω


RequiresUnreferencedCodeAttribute Class

Definition

Indicates that the specified method requires dynamic access to code that is not referenced statically, for example, through System.Reflection.

public ref class RequiresUnreferencedCodeAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Constructor | System.AttributeTargets.Method, Inherited=false)]
public sealed class RequiresUnreferencedCodeAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method, Inherited=false)]
public sealed class RequiresUnreferencedCodeAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Constructor | System.AttributeTargets.Method, Inherited=false)>]
type RequiresUnreferencedCodeAttribute = class
    inherit Attribute
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method, Inherited=false)>]
type RequiresUnreferencedCodeAttribute = class
    inherit Attribute
Public NotInheritable Class RequiresUnreferencedCodeAttribute
Inherits Attribute
Inheritance
RequiresUnreferencedCodeAttribute
Attributes

Remarks

This attribute allows tools to understand which methods are unsafe to call when removing unreferenced code from an application. For more information, see Introduction to trim warnings.

Constructors

RequiresUnreferencedCodeAttribute(String)

Initializes a new instance of the RequiresUnreferencedCodeAttribute class with the specified message.

Properties

Message

Gets a message that contains information about the usage of unreferenced code.

TypeId

When implemented in a derived class, gets a unique identifier for this Attribute.

(Inherited from Attribute)
Url

Gets or sets an optional URL that contains more information about the method, why it requires unreferenced code, and what options a consumer has to deal with it.

Methods

Equals(Object)

Returns a value that indicates whether this instance is equal to a specified object.

(Inherited from Attribute)
GetHashCode()

Returns the hash code for this instance.

(Inherited from Attribute)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
IsDefaultAttribute()

When overridden in a derived class, indicates whether the value of this instance is the default value for the derived class.

(Inherited from Attribute)
Match(Object)

When overridden in a derived class, returns a value that indicates whether this instance equals a specified object.

(Inherited from Attribute)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to

See also