NAnt SDK Documentation - v0.92

AssemblyFunctions.LoadFromFile Method 

Loads an assembly given its file name or path.

[Visual Basic]
<Function(Name:="load-from-file")>
Public Function LoadFromFile( _
   ByVal assemblyFile As String _
) As Assembly
[C#]
[Function(Name="load-from-file")]
public Assembly LoadFromFile(
   string assemblyFile
);

Parameters

assemblyFile
The name or path of the file that contains the manifest of the assembly.

Return Value

The loaded assembly.

Exceptions

Exception Type Condition
ArgumentException assemblyFile is an empty String.
FileNotFoundException assemblyFile is not found, or the module you are trying to load does not specify a filename extension.
BadImageFormatException assemblyFile is not a valid assembly.
PathTooLongException An assembly or module was loaded twice with two different evidences, or the assembly name is longer than MAX_PATH characters.

See Also

AssemblyFunctions Class | NAnt.Core.Functions Namespace