ModuleBuilder.DefineType Method (String)
Microsoft Silverlight will reach end of support after October 2021. Learn more.
Defines a private type with the specified name in this module.
Namespace:  System.Reflection.Emit
Assembly:  mscorlib (in mscorlib.dll)
Syntax
'Declaration
<SecuritySafeCriticalAttribute> _
Public Function DefineType ( _
    name As String _
) As TypeBuilder
[SecuritySafeCriticalAttribute]
public TypeBuilder DefineType(
    string name
)
Parameters
- name
 Type: System.String
 The full name of the type, including the namespace. name cannot contain embedded nulls.
Return Value
Type: System.Reflection.Emit.TypeBuilder
A private type with the specified name.
Exceptions
| Exception | Condition | 
|---|---|
| ArgumentException | A type with the given name exists in the parent assembly of this module. -or- Nested type attributes are set on a type that is not nested. | 
| ArgumentNullException | name is nulla null reference (Nothing in Visual Basic). | 
Remarks
Type names must be unique within an assembly. Private types can be used only within the dynamic module.
Version Information
Silverlight
Supported in: 5, 4, 3
Platforms
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.