This documentation is archived and is not being maintained.

BuildManager.GetType Method (String, Boolean)

Finds a type within the top-level assemblies or assemblies defined in configuration and optionally throws an exception on failure.

Namespace: System.Web.Compilation
Assembly: System.Web (in system.web.dll)

public static Type GetType (
	string typeName,
	bool throwOnError
public static Type GetType (
	String typeName, 
	boolean throwOnError
public static function GetType (
	typeName : String, 
	throwOnError : boolean
) : Type
Not applicable.



The type name.


true to throw an exception if a Type object cannot be generated for the type name; otherwise, false.

Return Value

A Type for the requested typeName.

Exception typeCondition


typeName is invalid.

- or -

typeName is ambiguous.

- or -

typeName could not be found, and throwOnError is true.

A top-level assembly refers to the Global.asax file, or a file in the App_GlobalResources, App_WebReferences, App_Code, or App_Browsers directory.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0