Assembly.Load Method (String)

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Loads an assembly given the long form of its name.

Namespace: System.Reflection
Assembly: mscorlib (in mscorlib.dll)

Syntax

Public Shared Function Load ( _
    assemblyString As String _
) As Assembly
public static Assembly Load(
    string assemblyString
)

Parameters

Return Value

Type: System.Reflection..::.Assembly
The loaded assembly.

Exceptions

Exception Condition
ArgumentNullException

assemblyString is nullNothingnullptra null reference (Nothing in Visual Basic).

ArgumentException

assemblyString is a zero-length string.

FileNotFoundException

assemblyString is not found.

FileLoadException

A file that was found could not be loaded.

BadImageFormatException

assemblyString is not a valid assembly.

-or-

assemblyString was compiled for a later version of the common language runtime than the currently executing version.

Remarks

FileLoadException is thrown if assemblyString specifies the full assembly name, and the first assembly that matches the simple name has a different version, culture, or public key token. The loader does not continue probing for other assemblies that match the simple name.

Version Notes

Windows Phone

If you pass an invalid string to the Load method, it throws an IOException exception instead of an ArgumentException exception.

Version Information

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Platforms

Windows Phone

See Also

Reference

Assembly Class

Load Overload

System.Reflection Namespace

AssemblyName