Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

LicenseManager Class

Provides properties and methods to add a license to a component and to manage a LicenseProvider. This class cannot be inherited.

For a list of all members of this type, see LicenseManager Members.


[Visual Basic]
NotInheritable Public Class LicenseManager
public sealed class LicenseManager
public __gc __sealed class LicenseManager
public class LicenseManager

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.


LicenseManager provides the following static (Shared in Visual Basic) properties: CurrentContext and UsageMode. The class also provides the following static (Shared in Visual Basic) methods: CreateWithContext, IsValid, Validate.

When you create a component that you want to license, you must:

  1. Specify the LicenseProvider by marking the component with a LicenseProviderAttribute.
  2. Call Validate or IsValid in the constructor of the component. Validate throws a LicenseException when it tries to create an instance without a valid license. IsValid does not throw an exception.
  3. Dispose any license that is granted when the component is disposed or finalized.

For more information on licensing, see Licensing Components and Controls.


Namespace: System.ComponentModel

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: System (in System.dll)

See Also

LicenseManager Members | System.ComponentModel Namespace | License | LicenseContext | LicenseException | LicenseProvider | LicenseProviderAttribute | LicFileLicenseProvider | LicenseUsageMode

© 2015 Microsoft