AssemblyBuilder.DefineDynamicAssembly Method

Definition

Defines a dynamic assembly.

Overloads

DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess)

Defines a dynamic assembly that has the specified name and access rights.

DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, IEnumerable<CustomAttributeBuilder>)

Defines a new assembly that has the specified name, access rights, and attributes.

DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess)

Source:
AssemblyBuilder.cs
Source:
RuntimeAssemblyBuilder.cs
Source:
RuntimeAssemblyBuilder.cs

Defines a dynamic assembly that has the specified name and access rights.

C#
public static System.Reflection.Emit.AssemblyBuilder DefineDynamicAssembly(System.Reflection.AssemblyName name, System.Reflection.Emit.AssemblyBuilderAccess access);

Parameters

name
AssemblyName

The name of the assembly.

access
AssemblyBuilderAccess

The access rights of the assembly.

Returns

An object that represents the new assembly.

Applies to

.NET 10 and other versions
Product Versions
.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 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

DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, IEnumerable<CustomAttributeBuilder>)

Source:
AssemblyBuilder.cs
Source:
RuntimeAssemblyBuilder.cs
Source:
RuntimeAssemblyBuilder.cs

Defines a new assembly that has the specified name, access rights, and attributes.

C#
public static System.Reflection.Emit.AssemblyBuilder DefineDynamicAssembly(System.Reflection.AssemblyName name, System.Reflection.Emit.AssemblyBuilderAccess access, System.Collections.Generic.IEnumerable<System.Reflection.Emit.CustomAttributeBuilder>? assemblyAttributes);
C#
public static System.Reflection.Emit.AssemblyBuilder DefineDynamicAssembly(System.Reflection.AssemblyName name, System.Reflection.Emit.AssemblyBuilderAccess access, System.Collections.Generic.IEnumerable<System.Reflection.Emit.CustomAttributeBuilder> assemblyAttributes);

Parameters

name
AssemblyName

The name of the assembly.

access
AssemblyBuilderAccess

The access rights of the assembly.

assemblyAttributes
IEnumerable<CustomAttributeBuilder>

A collection that contains the attributes of the assembly.

Returns

An object that represents the new assembly.

Applies to

.NET 10 and other versions
Product Versions
.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 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