PersistedAssemblyBuilder Class

Definition

Provides an AssemblyBuilder implementation that can persist assembly to a disk or stream.

public sealed class PersistedAssemblyBuilder : System.Reflection.Emit.AssemblyBuilder
Inheritance
PersistedAssemblyBuilder

Remarks

For more information about this API, see Persisted dynamic assemblies in .NET.

Warning

PersistedAssemblyBuilder APIs require a fully trusted environment with trusted input, similar to other technologies such as compilers. There are no restrictions other than basic validation for generated IL that the AssemblyBuilder can contain. That includes validation for member name, count, and associated metadata, such as custom attributes.

Constructors

Properties

CodeBase
Obsolete.

Gets the location of the assembly, as specified originally (such as in an AssemblyName object).

(Inherited from AssemblyBuilder)
CustomAttributes

Gets a collection that contains this assembly's custom attributes.

(Inherited from Assembly)
DefinedTypes (Inherited from AssemblyBuilder)
EntryPoint

Returns the entry point of this assembly.

(Inherited from AssemblyBuilder)
EscapedCodeBase
Obsolete.
Obsolete.

Gets the URI, including escape characters, that represents the codebase.

(Inherited from Assembly)
Evidence

Gets the evidence for this assembly.

(Inherited from AssemblyBuilder)
ExportedTypes

Gets a collection of the public types defined in this assembly that are visible outside the assembly.

(Inherited from Assembly)
FullName

Gets the display name of the current dynamic assembly.

GlobalAssemblyCache
Obsolete.

Gets a value that indicates whether the assembly was loaded from the global assembly cache.

(Inherited from AssemblyBuilder)
HostContext

Gets the host context where the dynamic assembly is being created.

(Inherited from AssemblyBuilder)
ImageRuntimeVersion

Gets the version of the common language runtime that will be saved in the file containing the manifest.

(Inherited from AssemblyBuilder)
IsCollectible

Gets a value that indicates whether this dynamic assembly is held in a collectible AssemblyLoadContext.

(Inherited from AssemblyBuilder)
IsDynamic

Gets a value that indicates that the current assembly is a dynamic assembly.

(Inherited from AssemblyBuilder)
IsFullyTrusted

Gets a value that indicates whether the current assembly is loaded with full trust.

(Inherited from Assembly)
Location

Gets the location, in codebase format, of the loaded file that contains the manifest if it is not shadow-copied.

(Inherited from AssemblyBuilder)
ManifestModule

Gets the module in the current PersistedAssemblyBuilder that contains the assembly manifest.

Modules (Inherited from AssemblyBuilder)
PermissionSet

Gets the grant set of the current dynamic assembly.

(Inherited from AssemblyBuilder)
ReflectionOnly

Gets a value indicating whether the dynamic assembly is in the reflection-only context.

(Inherited from AssemblyBuilder)
SecurityRuleSet

Gets a value that indicates which set of security rules the common language runtime (CLR) enforces for this assembly.

(Inherited from AssemblyBuilder)

Methods

AddResourceFile(String, String, ResourceAttributes)

Adds an existing resource file to this assembly.

(Inherited from AssemblyBuilder)
AddResourceFile(String, String)

Adds an existing resource file to this assembly.

(Inherited from AssemblyBuilder)
CreateInstance(String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[])

Locates the specified type from this assembly and creates an instance of it using the system activator, with optional case-sensitive search and having the specified culture, arguments, and binding and activation attributes.

(Inherited from Assembly)
CreateInstance(String, Boolean)

Locates the specified type from this assembly and creates an instance of it using the system activator, with optional case-sensitive search.

(Inherited from Assembly)
CreateInstance(String)

Locates the specified type from this assembly and creates an instance of it using the system activator, using case-sensitive search.

(Inherited from Assembly)
DefineDynamicModule(String, Boolean)

Defines a named transient dynamic module in this assembly and specifies whether symbol information should be emitted.

(Inherited from AssemblyBuilder)
DefineDynamicModule(String, String, Boolean)

Defines a persistable dynamic module, specifying the module name, the name of the file to which the module will be saved, and whether symbol information should be emitted using the default symbol writer.

(Inherited from AssemblyBuilder)
DefineDynamicModule(String, String)

Defines a persistable dynamic module with the given name that will be saved to the specified file. No symbol information is emitted.

(Inherited from AssemblyBuilder)
DefineDynamicModule(String)

Defines a named transient dynamic module in this assembly.

(Inherited from AssemblyBuilder)
DefineDynamicModuleCore(String)

When overridden in a derived class, defines a dynamic module in this assembly.

(Inherited from AssemblyBuilder)
DefineResource(String, String, String, ResourceAttributes)

Defines a standalone managed resource for this assembly. Attributes can be specified for the managed resource.

(Inherited from AssemblyBuilder)
DefineResource(String, String, String)

Defines a standalone managed resource for this assembly with the default public resource attribute.

(Inherited from AssemblyBuilder)
DefineUnmanagedResource(Byte[])

Defines an unmanaged resource for this assembly as an opaque blob of bytes.

(Inherited from AssemblyBuilder)
DefineUnmanagedResource(String)

Defines an unmanaged resource file for this assembly given the name of the resource file.

(Inherited from AssemblyBuilder)
DefineVersionInfoResource()

Defines an unmanaged version information resource using the information specified in the assembly's AssemblyName object and the assembly's custom attributes.

(Inherited from AssemblyBuilder)
DefineVersionInfoResource(String, String, String, String, String)

Defines an unmanaged version information resource for this assembly with the given specifications.

(Inherited from AssemblyBuilder)
Equals(Object)

Returns a value that indicates whether this instance is equal to the specified object.

(Inherited from AssemblyBuilder)
GenerateMetadata(BlobBuilder, BlobBuilder, MetadataBuilder)

Generates the metadata for the PersistedAssemblyBuilder.

GenerateMetadata(BlobBuilder, BlobBuilder)

Generates the metadata for the PersistedAssemblyBuilder.

GetCustomAttributes(Boolean)

Returns all the custom attributes that have been applied to the current AssemblyBuilder.

(Inherited from AssemblyBuilder)
GetCustomAttributes(Type, Boolean)

Returns all the custom attributes that have been applied to the current AssemblyBuilder, and that derive from a specified attribute type.

(Inherited from AssemblyBuilder)
GetCustomAttributesData()

Returns CustomAttributeData objects that contain information about the attributes that have been applied to the current AssemblyBuilder.

(Inherited from AssemblyBuilder)
GetDynamicModule(String)

Returns the dynamic module with the specified name.

(Inherited from AssemblyBuilder)
GetDynamicModuleCore(String)

When overridden in a derived class, returns the dynamic module with the specified name.

(Inherited from AssemblyBuilder)
GetExportedTypes()

Gets the exported types defined in this assembly.

(Inherited from AssemblyBuilder)
GetFile(String)

Gets a FileStream for the specified file in the file table of the manifest of this assembly.

(Inherited from AssemblyBuilder)
GetFiles()

Gets the files in the file table of an assembly manifest.

(Inherited from Assembly)
GetFiles(Boolean)

Gets the files in the file table of an assembly manifest, specifying whether to include resource modules.

(Inherited from AssemblyBuilder)
GetForwardedTypes() (Inherited from Assembly)
GetHashCode()

Returns the hash code for this instance.

(Inherited from AssemblyBuilder)
GetLoadedModules()

Gets all the loaded modules that are part of this assembly.

(Inherited from Assembly)
GetLoadedModules(Boolean)

Returns all the loaded modules that are part of this assembly, and optionally includes resource modules.

(Inherited from AssemblyBuilder)
GetManifestResourceInfo(String)

Returns information about how the given resource has been persisted.

(Inherited from AssemblyBuilder)
GetManifestResourceNames()

Loads the specified manifest resource from this assembly.

(Inherited from AssemblyBuilder)
GetManifestResourceStream(String)

Loads the specified manifest resource from this assembly.

(Inherited from AssemblyBuilder)
GetManifestResourceStream(Type, String)

Loads the specified manifest resource, scoped by the namespace of the specified type, from this assembly.

(Inherited from AssemblyBuilder)
GetModule(String)

Gets the specified module in this assembly.

(Inherited from AssemblyBuilder)
GetModules()

Gets all the modules that are part of this assembly.

(Inherited from Assembly)
GetModules(Boolean)

Gets all the modules that are part of this assembly, and optionally includes resource modules.

(Inherited from AssemblyBuilder)
GetName()

Gets an AssemblyName for this assembly.

(Inherited from Assembly)
GetName(Boolean)

Gets the AssemblyName that was specified when the current dynamic assembly was created.

GetObjectData(SerializationInfo, StreamingContext)
Obsolete.

Gets serialization information with all of the data needed to reinstantiate this assembly.

(Inherited from Assembly)
GetReferencedAssemblies()

Gets an incomplete list of AssemblyName objects for the assemblies that are referenced by this AssemblyBuilder.

(Inherited from AssemblyBuilder)
GetSatelliteAssembly(CultureInfo, Version)

Gets the specified version of the satellite assembly for the specified culture.

(Inherited from AssemblyBuilder)
GetSatelliteAssembly(CultureInfo)

Gets the satellite assembly for the specified culture.

(Inherited from AssemblyBuilder)
GetType() (Inherited from Assembly)
GetType(String, Boolean, Boolean)

Gets the specified type from the types that have been defined and created in the current AssemblyBuilder.

(Inherited from AssemblyBuilder)
GetType(String, Boolean)

Gets the Type object with the specified name in the assembly instance and optionally throws an exception if the type is not found.

(Inherited from Assembly)
GetType(String)

Gets the Type object with the specified name in the assembly instance.

(Inherited from Assembly)
GetTypes()

Gets all types defined in this assembly.

(Inherited from Assembly)
IsDefined(Type, Boolean)

Returns a value that indicates whether one or more instances of the specified attribute type is applied to this member.

(Inherited from AssemblyBuilder)
LoadModule(String, Byte[], Byte[])

Loads the module, internal to this assembly, with a common object file format (COFF)-based image containing an emitted module, or a resource file. The raw bytes representing the symbols for the module are also loaded.

(Inherited from Assembly)
LoadModule(String, Byte[])

Loads the module, internal to this assembly, with a common object file format (COFF)-based image containing an emitted module, or a resource file.

(Inherited from Assembly)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
Save(Stream)

Serializes the assembly to the specified stream.

Save(String, PortableExecutableKinds, ImageFileMachine)

Saves this dynamic assembly to disk, specifying the nature of code in the assembly's executables and the target platform.

(Inherited from AssemblyBuilder)
Save(String)

Saves the assembly to disk.

SetCustomAttribute(ConstructorInfo, Byte[])

Set a custom attribute on this assembly using a specified custom attribute blob.

(Inherited from AssemblyBuilder)
SetCustomAttribute(CustomAttributeBuilder)

Set a custom attribute on this assembly using a custom attribute builder.

(Inherited from AssemblyBuilder)
SetCustomAttributeCore(ConstructorInfo, ReadOnlySpan<Byte>)

When overridden in a derived class, sets a custom attribute on this assembly.

(Inherited from AssemblyBuilder)
SetEntryPoint(MethodInfo, PEFileKinds)

Sets the entry point for this assembly and defines the type of the portable executable (PE file) being built.

(Inherited from AssemblyBuilder)
SetEntryPoint(MethodInfo)

Sets the entry point for this dynamic assembly, assuming that a console application is being built.

(Inherited from AssemblyBuilder)
ToString()

Returns the full name of the assembly, also known as the display name.

(Inherited from Assembly)

Events

ModuleResolve

Occurs when the common language runtime class loader cannot resolve a reference to an internal module of an assembly through normal means.

(Inherited from Assembly)

Extension Methods

GetExportedTypes(Assembly)
GetModules(Assembly)
GetTypes(Assembly)
GetCustomAttribute(Assembly, Type)

Retrieves a custom attribute of a specified type that is applied to a specified assembly.

GetCustomAttribute<T>(Assembly)

Retrieves a custom attribute of a specified type that is applied to a specified assembly.

GetCustomAttributes(Assembly, Type)

Retrieves a collection of custom attributes of a specified type that are applied to a specified assembly.

GetCustomAttributes(Assembly)

Retrieves a collection of custom attributes that are applied to a specified assembly.

GetCustomAttributes<T>(Assembly)

Retrieves a collection of custom attributes of a specified type that are applied to a specified assembly.

IsDefined(Assembly, Type)

Indicates whether custom attributes of a specified type are applied to a specified assembly.

TryGetRawMetadata(Assembly, Byte*, Int32)

Retrieves the metadata section of the assembly, for use with MetadataReader.

Applies to

Product Versions
.NET 9