Click or drag to resize
AssemblyGetType Method (String, Boolean, Boolean)
Gets the Type object with the specified name in the assembly instance, with the options of ignoring the case, and of throwing an exception if the type is not found.

Namespace: System.Reflection
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public virtual Type GetType(
	string name,
	bool throwOnError,
	bool ignoreCase
)

Parameters

name
Type: SystemString
The full name of the type.
throwOnError
Type: SystemBoolean
true to throw an exception if the type is not found; false to return null.
ignoreCase
Type: SystemBoolean
true to ignore the case of the type name; otherwise, false.

Return Value

Type: Type
An object that represents the specified class.
Exceptions
ExceptionCondition
ArgumentExceptionname is invalid.-or- The length of name exceeds 1024 characters.
ArgumentNullExceptionname is null.
TypeLoadExceptionthrowOnError is true, and the type cannot be found.
FileNotFoundExceptionname requires a dependent assembly that could not be found.
FileLoadExceptionname requires a dependent assembly that was found but could not be loaded.-or-The current assembly was loaded into the reflection-only context, and name requires a dependent assembly that was not preloaded.
BadImageFormatExceptionname requires a dependent assembly, but the file is not a valid assembly. -or-name requires a dependent assembly which was compiled for a version of the runtime later than the currently loaded version.
See Also