NAnt SDK Documentation - v0.92

AssemblyFunctions.Load Method 

Loads an assembly given the long form of its name.

[Visual Basic]
<Function(Name:="load")>
Public Function Load( _
   ByVal assemblyString As String _
) As Assembly
[C#]
[Function(Name="load")]
public Assembly Load(
   string assemblyString
);

Parameters

assemblyString
The long form of the assembly name.

Return Value

The loaded assembly.

Exceptions

Exception Type Condition
ArgumentNullException assemblyString is a a null reference (Nothing in Visual Basic).
FileNotFoundException assemblyString is not found.

Example

Determine the location of the Microsoft Access 11 Primary Interop Assembly by loading it using its fully qualified name, and copy it to the build directory.

    
<property name="access.pia.path" value="${assembly::get-location(assembly::load('Microsoft.Office.Interop.Access, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'))}" />
<copy file="${access.pia.path}" todir="${build.dir}" />
    
  

See Also

AssemblyFunctions Class | NAnt.Core.Functions Namespace