Click or drag to resize

ReflectionExtensionsCreateObject Method

Creates instance of a class from underlying assembly.

Namespace:  CSScriptLib
Assembly:  CSScriptLib (in CSScriptLib.dll) Version: 1.3.2.0
Syntax
C#
public static Object CreateObject(
	this Assembly asm,
	string typeName,
	params Object[] args
)

Parameters

asm
Type: System.ReflectionAssembly
The asm.
typeName
Type: SystemString
The 'Type' full name of the type to create. (see Assembly.CreateInstance()). You can use wild card meaning the first type found. However only full wild card "*" is supported.
args
Type: SystemObject
The non default constructor arguments.

Return Value

Type: Object
Instance of the 'Type'. Throws an ApplicationException if the instance cannot be created.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Assembly. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also