MetadataLoadContext MetadataLoadContext MetadataLoadContext MetadataLoadContext Class

Definition

Represents a closed universe of Type objects loaded for inspection-only purposes. Each MetadataLoadContext can have its own binding rules and is isolated from all other MetadataLoadContexts.

public ref class MetadataLoadContext sealed : IDisposable
public sealed class MetadataLoadContext : IDisposable
type MetadataLoadContext = class
    interface IDisposable
Public NotInheritable Class MetadataLoadContext
Implements IDisposable
Inheritance
MetadataLoadContextMetadataLoadContextMetadataLoadContextMetadataLoadContext
Implements

Remarks

A MetadataLoadContext serves as a dictionary that binds assembly names to Assembly instances that were previously loaded into the context or need to be loaded.

Assemblies are treated strictly as metadata. There are no restrictions on loading assemblies based on target platform, CPU architecture, or pointer size. There are no restrictions on the assembly designated as the core assembly (mscorlib).

Constructors

MetadataLoadContext(MetadataAssemblyResolver, String) MetadataLoadContext(MetadataAssemblyResolver, String) MetadataLoadContext(MetadataAssemblyResolver, String) MetadataLoadContext(MetadataAssemblyResolver, String)

Creates a new MetadataLoadContext object.

Properties

CoreAssembly CoreAssembly CoreAssembly CoreAssembly

Gets or sets the assembly that denotes the "system assembly" that houses the well-known types such as Int32.

Methods

Dispose() Dispose() Dispose() Dispose()

Releases any native resources (such as file locks on assembly files).

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetAssemblies() GetAssemblies() GetAssemblies() GetAssemblies()

Return an atomic snapshot of the assemblies that have been loaded into the MetadataLoadContext.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
LoadFromAssemblyName(AssemblyName) LoadFromAssemblyName(AssemblyName) LoadFromAssemblyName(AssemblyName) LoadFromAssemblyName(AssemblyName)

Resolves the supplied assembly name to an assembly. If an assembly was previously bound to this name, that assembly is returned. Otherwise, the MetadataLoadContext calls the specified MetadataAssemblyResolver.

LoadFromAssemblyName(String) LoadFromAssemblyName(String) LoadFromAssemblyName(String) LoadFromAssemblyName(String)

Resolves the supplied assembly name to an assembly. If an assembly was previously bound to this name, that assembly is returned. Otherwise, the MetadataLoadContext calls the specified MetadataAssemblyResolver.

LoadFromAssemblyPath(String) LoadFromAssemblyPath(String) LoadFromAssemblyPath(String) LoadFromAssemblyPath(String)

Loads an assembly from a specific path on the disk and binds its assembly name to it in the MetadataLoadContext. If a prior assembly with the same name was already loaded into the MetadataLoadContext, the prior assembly will be returned.

LoadFromByteArray(Byte[]) LoadFromByteArray(Byte[]) LoadFromByteArray(Byte[]) LoadFromByteArray(Byte[])

Loads an assembly from a byte array and binds its assembly name to it in the MetadataLoadContext. If a prior assembly with the same name was already loaded into the MetadataLoadContext, the prior assembly will be returned.

LoadFromStream(Stream) LoadFromStream(Stream) LoadFromStream(Stream) LoadFromStream(Stream)

Loads an assembly from a stream and binds its assembly name to it in the MetadataLoadContext. If a prior assembly with the same name was already loaded into the MetadataLoadContext, the prior assembly will be returned.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to