RequiresDynamicCodeAttribute 類別

定義

表示指定的方法需要在執行時間產生新的程式碼,例如透過 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
繼承
RequiresDynamicCodeAttribute
屬性

備註

此屬性可讓工具瞭解在預先編譯時呼叫哪些方法不安全。 如需詳細資訊,請參閱 AOT 警告簡介

建構函式

RequiresDynamicCodeAttribute(String)

使用指定的訊息初始化 RequiresDynamicCodeAttribute 類別的新執行個體。

屬性

Message

取得訊息,其中包含動態程式碼使用方式的相關資訊。

TypeId

在衍生類別中實作時,取得這個 Attribute 的唯一識別碼。

(繼承來源 Attribute)
Url

取得或設定選擇性 URL,其中包含方法的詳細資訊、為何需要動態程式碼,以及取用者必須處理的選項。

方法

Equals(Object)

傳回值,這個值指出此執行個體是否與指定的物件相等。

(繼承來源 Attribute)
GetHashCode()

傳回這個執行個體的雜湊碼。

(繼承來源 Attribute)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
IsDefaultAttribute()

在衍生類別中覆寫時,表示這個執行個體的值是衍生類別的預設值。

(繼承來源 Attribute)
Match(Object)

在衍生類別中覆寫時,會傳回值,表示這個執行個體是否等於指定物件。

(繼承來源 Attribute)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。

(繼承來源 Object)

適用於

另請參閱