Edit

Share via


AssemblyLoadContext.LoadFromNativeImagePath(String, String) Method

Definition

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

Parameters

nativeImagePath
String

The fully qualified path of the file to load.

assemblyPath
String

The fully qualified path of the IL version of the file to load, or null.

Returns

The loaded assembly.

Exceptions

The nativeImagePath argument is not an absolute path.

The assemblyPath argument is not an absolute path.

The nativeImagePath argument is null.

A file that was found could not be loaded.

The nativeImagePath argument is an empty string ("") or does not exist.

The assemblyPath argument is not a valid assembly.

Remarks

The native image of a managed assembly is pre-jitted to optimize running on a specific platform.

The assembly path refers to the path to the IL version of the assembly. 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.

Applies to

See also