AssemblyLoadContext.LoadFromNativeImagePath(String, String) AssemblyLoadContext.LoadFromNativeImagePath(String, String) AssemblyLoadContext.LoadFromNativeImagePath(String, String) AssemblyLoadContext.LoadFromNativeImagePath(String, String) Method

定义

在指定路径上加载托管程序集文件的本机映像的内容。Loads the contents of the native image of a managed assembly file on the specified path.

public:
 System::Reflection::Assembly ^ LoadFromNativeImagePath(System::String ^ nativeImagePath, System::String ^ assemblyPath);
public System.Reflection.Assembly LoadFromNativeImagePath (string nativeImagePath, string assemblyPath);
member this.LoadFromNativeImagePath : string * string -> System.Reflection.Assembly
Public Function LoadFromNativeImagePath (nativeImagePath As String, assemblyPath As String) As Assembly

参数

nativeImagePath
String String String String

要加载的文件的完全限定路径。The fully qualified path of the file to load.

assemblyPath
String String String String

要加载的文件的 IL 版本的完全限定路径,或为 nullThe fully qualified path of the IL version of the file to load, or null.

返回

加载的程序集。The loaded assembly.

异常

nativeImagePath 参数不是绝对路径。The nativeImagePath argument is not an absolute path.

assemblyPath 参数不是绝对路径。The assemblyPath argument is not an absolute path.

nativeImagePath 参数为 nullThe nativeImagePath parameter is null.

无法加载已找到的文件。A file that was found could not be loaded.

nativeImagePath 参数为空字符串 ("") 或不存在。The nativeImagePath parameter is an empty string ("") or does not exist.

assemblyPath 不是有效的程序集。assemblyPath is not a valid assembly.

注解

托管程序集的本机映像是预实时编译以优化特定平台上运行。The native image of a managed assembly is pre-jitted to optimize running on a specific platform.

程序集路径指向的 IL 版本的程序集的路径。The assembly path refers to the path to the IL version of the assembly. 因为 IL 通常包含在本机映像,它是一个可选参数。It is an optional argument as the IL is typically included in the native image. 它可由运行时作为回退如果找不到本机映像。It can be used by the runtime as a fallback if the native image is not found.

适用于