CreateInstanceAccessorCreateInstance Method

Creates a new instance using the associated Type or parameterless constructor.
See the Remarks section of the CreateInstance(Object) overload for details.

Definition

Namespace: KGySoft.Reflection
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 8.1.0
C#
public Object CreateInstance()

Return Value

Object
The created instance.

Exceptions

ArgumentExceptionThe constructor expects parameters.
InvalidOperationExceptionThis CreateInstanceAccessor represents a static constructor, a constructor of an abstract class, or.a constructor of an open generic type.
NotSupportedExceptionOn .NET Framework the code is executed in a partially trusted domain with insufficient permissions.

See Also