AssemblyLoadContext.LoadFromNativeImagePath(String, String) 方法

定義

將受管理組合檔的原生映像檔內容載入指定路徑。

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

參數

nativeImagePath
String

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

assemblyPath
String

IL 版本檔案的完全限定路徑載入,或 null

傳回

裝填組件。

屬性

例外狀況

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

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

nativeImagePath 點為 null

找到的檔案無法載入。

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

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

備註

管理組裝的原生映像會預先合成,以優化在特定平台上的運行。

組裝路徑指的是組裝的 IL 版本的路徑。 這是可選的參數,因為 IL 通常包含在原生映像中。 執行時若找不到原生映像檔,可用作備援。

適用於

另請參閱