語言

AssemblyLoadContext.LoadFromAssemblyPath(String) 方法

定義

載入指定路徑上元件檔案的內容。

public:
 System::Reflection::Assembly ^ LoadFromAssemblyPath(System::String ^ assemblyPath);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types and members the loaded assembly depends on might be removed")]
public System.Reflection.Assembly LoadFromAssemblyPath(string assemblyPath);
public System.Reflection.Assembly LoadFromAssemblyPath(string assemblyPath);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types and members the loaded assembly depends on might be removed")>]
member this.LoadFromAssemblyPath : string -> System.Reflection.Assembly
member this.LoadFromAssemblyPath : string -> System.Reflection.Assembly
Public Function LoadFromAssemblyPath (assemblyPath As String) As Assembly

參數

assemblyPath
String

檔案載入的完全限定路徑。

傳回

裝填組件。

屬性

例外狀況

這個 assemblyPath 論點並非絕對的路徑。

論 assemblyPath 點為 null。

找到的檔案無法載入。

參數 assemblyPath 為空字串(“”)或不存在。

這個 assemblyPath 論點不是一個有效的集合。

備註

當在上下文中呼叫 Default 此方法時,若組裝名稱與預設探測路徑中的組裝相符,則載入的是預設探測路徑中的組裝件,而非指定路徑上的組裝。 欲了解更多預設探測資訊,請參閱 管理組裝裝填演算法。

適用於

另請參閱