This documentation is archived and is not being maintained.

LicenseManager.CreateWithContext Method (Type, LicenseContext, Object[])

Creates an instance of the specified type with the specified arguments, given a context in which you can use the licensed instance.

Namespace:  System.ComponentModel
Assembly:  System (in System.dll)

public static Object CreateWithContext(
	Type type,
	LicenseContext creationContext,
	Object[] args


Type: System.Type
A Type that represents the type to create.
Type: System.ComponentModel.LicenseContext
A LicenseContext that specifies when you can use the licensed instance.
Type: System.Object[]
An array of type Object that represents the arguments for the type.

Return Value

Type: System.Object
An instance of the specified type with the given array of arguments.

The LicenseContext you specify as the creationContext parameter is used as the CurrentContext for the life of this License. This method blocks all other threads in the AppDomain from modifying the CurrentContext, allowing CreateWithContext to behave as an atomic operation.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.