ModuleBuilder.SetCustomAttribute Metodo
In questo articolo
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Applica un attributo personalizzato al modulo.
Overload
SetCustomAttribute(CustomAttributeBuilder) |
Applica un attributo personalizzato al modulo utilizzando un generatore di attributi personalizzati. |
SetCustomAttribute(ConstructorInfo, Byte[]) |
Applica un attributo personalizzato al modulo tramite un oggetto binario di grandi dimensioni (BLOB) specificato che rappresenta l'attributo. |
- Origine:
- ModuleBuilder.cs
- Origine:
- ModuleBuilder.cs
- Origine:
- ModuleBuilder.cs
Applica un attributo personalizzato al modulo utilizzando un generatore di attributi personalizzati.
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)
Parametri
- customBuilder
- CustomAttributeBuilder
Istanza di una classe di supporto che consente di specificare l'attributo personalizzato da applicare.
Eccezioni
customBuilder
è null
.
Commenti
Nota
A partire da .NET Framework 2.0 Service Pack 1, questo membro non richiede ReflectionPermission più con il ReflectionPermissionFlag.ReflectionEmit flag . Vedere Problemi di sicurezza in Reflection Emit. Per usare questa funzionalità, l'applicazione deve avere come destinazione .NET Framework 3.5 o versione successiva.
Si applica a
.NET 10 e altre versioni
Prodotto | Versioni |
---|---|
.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, 10 |
.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 |
- Origine:
- ModuleBuilder.cs
- Origine:
- ModuleBuilder.cs
- Origine:
- ModuleBuilder.cs
Applica un attributo personalizzato al modulo tramite un oggetto binario di grandi dimensioni (BLOB) specificato che rappresenta l'attributo.
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())
Parametri
- con
- ConstructorInfo
Costruttore dell'attributo personalizzato.
- binaryAttribute
- Byte[]
BLOB di byte che rappresenta l'attributo.
- Attributi
Eccezioni
con
o binaryAttribute
è null
.
Commenti
Per altre informazioni su come formattare binaryAttribute
, vedere la documentazione di Common Language Infrastructure (CLI), in particolare "Partition II: Metadata Definition and Semantics". Per altre informazioni, vedere ECMA 335 Common Language Infrastructure (CLI).For more information, see ECMA 335 Common Language Infrastructure (CLI).
Nota
A partire da .NET Framework 2.0 Service Pack 1, questo membro non richiede ReflectionPermission più con il ReflectionPermissionFlag.ReflectionEmit flag . Vedere Problemi di sicurezza in Reflection Emit. Per usare questa funzionalità, l'applicazione deve avere come destinazione .NET Framework 3.5 o versione successiva.
Si applica a
.NET 10 e altre versioni
Prodotto | Versioni |
---|---|
.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, 10 |
.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 |
Feedback su .NET
.NET è un progetto di open source. Selezionare un collegamento per fornire feedback: