ModuleBuilder.SetCustomAttribute メソッド
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
カスタム属性をこのモジュールに適用します。
SetCustomAttribute(CustomAttributeBuilder) |
カスタム属性ビルダーを使用して、カスタム属性をこのモジュールに適用します。 |
SetCustomAttribute(ConstructorInfo, Byte[]) |
属性を表す指定したバイナリ ラージ オブジェクト (BLOB) を使用して、カスタム属性をこのモジュールに適用します。 |
- ソース:
- ModuleBuilder.cs
- ソース:
- ModuleBuilder.cs
- ソース:
- ModuleBuilder.cs
カスタム属性ビルダーを使用して、カスタム属性をこのモジュールに適用します。
public:
void SetCustomAttribute(System::Reflection::Emit::CustomAttributeBuilder ^ customBuilder);
public void SetCustomAttribute(System.Reflection.Emit.CustomAttributeBuilder customBuilder);
member this.SetCustomAttribute : System.Reflection.Emit.CustomAttributeBuilder -> unit
Public Sub SetCustomAttribute (customBuilder As CustomAttributeBuilder)
パラメーター
- customBuilder
- CustomAttributeBuilder
適用するカスタム属性を指定するためのヘルパー クラスのインスタンス。
例外
customBuilder
は null
です。
注釈
注意
.NET Framework 2.0 Service Pack 1 以降では、このメンバーは フラグをReflectionPermissionFlag.ReflectionEmit使用する必要ReflectionPermissionがなくなりました。 (リフレクション出力のセキュリティの問題に関するページを参照してください)。この機能を使用するには、アプリケーションで .NET Framework 3.5 以降をターゲットにする必要があります。
適用対象
.NET 9 およびその他のバージョン
製品 | バージョン |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0 (package-provided), 2.1 |
- ソース:
- ModuleBuilder.cs
- ソース:
- ModuleBuilder.cs
- ソース:
- ModuleBuilder.cs
属性を表す指定したバイナリ ラージ オブジェクト (BLOB) を使用して、カスタム属性をこのモジュールに適用します。
public:
void SetCustomAttribute(System::Reflection::ConstructorInfo ^ con, cli::array <System::Byte> ^ binaryAttribute);
public void SetCustomAttribute(System.Reflection.ConstructorInfo con, byte[] binaryAttribute);
[System.Runtime.InteropServices.ComVisible(true)]
public void SetCustomAttribute(System.Reflection.ConstructorInfo con, byte[] binaryAttribute);
member this.SetCustomAttribute : System.Reflection.ConstructorInfo * byte[] -> unit
[<System.Runtime.InteropServices.ComVisible(true)>]
member this.SetCustomAttribute : System.Reflection.ConstructorInfo * byte[] -> unit
Public Sub SetCustomAttribute (con As ConstructorInfo, binaryAttribute As Byte())
パラメーター
- con
- ConstructorInfo
カスタム属性のコンストラクター。
- binaryAttribute
- Byte[]
属性を表すバイト BLOB。
- 属性
例外
con
または binaryAttribute
が null
です。
注釈
の書式設定 binaryAttribute
方法の詳細については、共通言語インフラストラクチャ (CLI) のドキュメント(特にパーティション II: メタデータ定義とセマンティクス)を参照してください。 詳細については、「 ECMA 335 共通言語インフラストラクチャ (CLI)」を参照してください。
注意
.NET Framework 2.0 Service Pack 1 以降では、このメンバーは フラグをReflectionPermissionFlag.ReflectionEmit使用する必要ReflectionPermissionがなくなりました。 (リフレクション出力のセキュリティの問題に関するページを参照してください)。この機能を使用するには、アプリケーションで .NET Framework 3.5 以降をターゲットにする必要があります。
適用対象
.NET 9 およびその他のバージョン
製品 | バージョン |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0 (package-provided), 2.1 |
.NET に関するフィードバック
.NET はオープンソース プロジェクトです。 フィードバックを提供するにはリンクを選択します。