Summary
Loads the type specified in the type string with assembly qualified name.
- Assembly
- NAnt
.Core .dll - Namespace
- NAnt
.Core .Util - Containing Type
- ReflectionUtils
Syntax
public static Type GetTypeFromString(string typeName, bool throwOnError)
Remarks
If the
System.Type
cannot be instantiated from the assembly
qualified type name, then we'll try to instantiate the type using its
simple type name from an already loaded assembly with an assembly
name matching the assembly in the assembly qualified type name.
Parameters
Name | Type | Description |
---|---|---|
typeName | string | The assembly qualified name of the type to load. |
throwOnError | bool | Flag set to true to throw an exception if the type cannot be loaded. |
Return Value
Type | Description |
---|---|
Type |
The type loaded or null if it could not be loaded.
|