Rediger

Del via


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
MetadataLoadContext
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).

For more information and examples, see How to: Inspect assembly contents using MetadataLoadContext.

Constructors

MetadataLoadContext(MetadataAssemblyResolver, String)

Creates a new MetadataLoadContext object.

Properties

CoreAssembly

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

Methods

Dispose()

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

Equals(Object)

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

(Inherited from Object)
GetAssemblies()

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

GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
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)

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)

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[])

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)

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()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to