NAnt SDK Documentation - v0.92

ConsoleDriver.CreateListener Method 

Dynamically constructs an IBuildListener instance of the class specified.

[Visual Basic]
<ReflectionPermission(Flags:=ReflectionPermissionFlag.NoFlags, TypeInformation:=False, MemberAccess:=False, ReflectionEmit:=False, RestrictedMemberAccess:=False, Action:=SecurityAction.Demand, Unrestricted:=False)>
Public Shared Function CreateListener( _
   ByVal typeName As String _
) As IBuildListener
[C#]
[ReflectionPermission(Flags=ReflectionPermissionFlag.NoFlags, TypeInformation=False, MemberAccess=False, ReflectionEmit=False, RestrictedMemberAccess=False, Action=SecurityAction.Demand, Unrestricted=False)]
public static IBuildListener CreateListener(
   string typeName
);

Parameters

typeName
The fully qualified name of the listener that should be instantiated.

Remarks

At this point, only looks in the assembly where IBuildListener is defined.

Exceptions

Exception TypeCondition
TypeLoadExceptionType typeName could not be loaded.
ArgumentExceptiontypeName does not implement IBuildListener.

See Also

ConsoleDriver Class | NAnt.Core Namespace