Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

AssemblyLoadContext.LoadFromNativeImagePath(String, String) Method

Definition

Namespace:
System.Runtime.Loader
Assembly:
System.Runtime.Loader.dll
Source:
AssemblyLoadContext.cs
Source:
AssemblyLoadContext.cs
Source:
AssemblyLoadContext.cs
Source:
AssemblyLoadContext.cs
Source:
AssemblyLoadContext.cs

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

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

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.

Attributes

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


Feedback

Was this page helpful?