MetadataLoadContext MetadataLoadContext MetadataLoadContext MetadataLoadContext Class

定義

代表針對僅限檢測目的載入的 Type 物件封閉宇宙。Represents a closed universe of Type objects loaded for inspection-only purposes. 每個 MetadataLoadContext 都可以有它自己的繫結規則,而且它與所有其他 MetadataLoadContext 隔離。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
繼承
MetadataLoadContextMetadataLoadContextMetadataLoadContextMetadataLoadContext
實作

備註

AMetadataLoadContext做為繫結至組件名稱的字典Assembly先前已載入至內容或必須能夠載入的執行個體。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. 沒有載入組件,根據目標平台、 CPU 架構或指標大小的限制。There are no restrictions on loading assemblies based on target platform, CPU architecture, or pointer size. 沒有任何限制在指定為核心組件的組件 (mscorlib)。There are no restrictions on the assembly designated as the core assembly (mscorlib).

建構函式

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

建立新的 MetadataLoadContext 物件。Creates a new MetadataLoadContext object.

屬性

CoreAssembly CoreAssembly CoreAssembly CoreAssembly

取得或設定表示裝載已知型別 (例如 Int32) 之「系統組件」的組件。Gets or sets the assembly that denotes the "system assembly" that houses the well-known types such as Int32.

方法

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

傳回已載入到 MetadataLoadContext 之組件的不可部分完成快照集。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()

取得目前執行個體的 TypeGets 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. 否則,MetadataLoadContext 會呼叫指定的 MetadataAssemblyResolverOtherwise, 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. 否則,MetadataLoadContext 會呼叫指定的 MetadataAssemblyResolverOtherwise, the MetadataLoadContext calls the specified MetadataAssemblyResolver.

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

從磁碟上的指定路徑載入組件,並在 MetadataLoadContext 中將其組件名稱繫結到它。Loads an assembly from a specific path on the disk and binds its assembly name to it in the MetadataLoadContext. 若具有相同名稱的先前組件已載入到 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[])

從二進位陣列載入組件並在 MetadataLoadContext 中將其組件組件名稱繫結到它。Loads an assembly from a byte array and binds its assembly name to it in the MetadataLoadContext. 若具有相同名稱的先前組件已載入到 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)

串流載入組件並在 MetadataLoadContext 中將其組件名稱繫結到它。Loads an assembly from a stream and binds its assembly name to it in the MetadataLoadContext. 若具有相同名稱的先前組件已載入到 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()

建立目前 Object 的淺層複本 (Shallow Copy)。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)

適用於