Redigera

Dela via


RequiresDynamicCodeAttribute Class

Definition

Indicates that the specified method requires the ability to generate new code at runtime, for example through System.Reflection.

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

Remarks

This attribute allows tools to understand which methods are unsafe to call when compiling ahead of time. For more information, see Introduction to AOT warnings.

Constructors

RequiresDynamicCodeAttribute(String)

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

Properties

Message

Gets a message that contains information about the usage of dynamic 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 dynamic 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