PathAssemblyResolver 類別

定義

代表中繼資料元件解析程式,其使用可能載入之每個元件的路徑。Represents a metadata assembly resolver that uses paths to every assembly that may be loaded.

public ref class PathAssemblyResolver : System::Reflection::MetadataAssemblyResolver
public class PathAssemblyResolver : System.Reflection.MetadataAssemblyResolver
type PathAssemblyResolver = class
    inherit MetadataAssemblyResolver
Public Class PathAssemblyResolver
Inherits MetadataAssemblyResolver
繼承
PathAssemblyResolver

備註

檔案名應該與元件的簡單名稱相同。The file name is expected to be the same as the assembly's simple name. 多個元件可以存在於具有相同名稱但位於不同目錄的磁片上。Multiple assemblies can exist on disk with the same name but in different directories. 的單一實例 PathAssemblyResolver 可以搭配多個實例使用 MetadataAssemblyResolverA single instance of PathAssemblyResolver can be used with multiple MetadataAssemblyResolver instances.

為了讓 AssemblyName 符合載入的元件, AssemblyName.Name 必須有相等的 (已忽略) 的大小寫。In order for an AssemblyName to match a loaded assembly, AssemblyName.Name must be equal (casing ignored).

  • 如果指定了公開金鑰 token AssemblyName ,它必須相等。If a public key token is specified for the AssemblyName, it must be equal.
  • 如果未指定公開金鑰 token AssemblyName ,則會選取不含公開金鑰 token 的元件,而不是使用公開金鑰標記。If a public key token is not specified for AssemblyName, assemblies with no public key token are selected over those with a public key token.
  • 如果有一個以上的元件相符,則會傳回具有最高的元件 AssemblyName.VersionIf more than one assembly matches, the assembly with the highest AssemblyName.Version is returned.
  • AssemblyName.CultureName 會被忽略。AssemblyName.CultureName is ignored.

建構函式

PathAssemblyResolver(IEnumerable<String>)

初始化 PathAssemblyResolver 類別的新執行個體。Initializes a new instance of the PathAssemblyResolver class.

方法

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(繼承來源 Object)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
Resolve(MetadataLoadContext, AssemblyName)

從指定的元件名稱傳回元件。Returns an assembly from a given assembly name.

ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)

適用於