[]
        
(Showing Draft Content)

License User Controls

.NET allows you to create user controls and class libraries—reusable components that can be built in one project and used by other applications.

When a ComponentOne control is used inside a user control or class library, the final application must still be properly licensed. In some scenarios, the user control or library itself must also be licensed to ensure the application runs without licensing errors.

This topic explains the supported approaches.

Choose the Appropriate Licensing Approach

Use the table below to determine which method applies to your scenario:

Scenario

Recommended Approach

User control is always used by a known application

Strong-name signing

Application name is known at build time

Generate a runtime license for the user control

Application name is unknown (plugin scenario)

Plugin license

Option 1: Use Strong-Name Signing

If the user control (or class library) is signed with the same strong-name key as the calling application:

  • The application’s runtime license can be accepted by the user control

  • No separate runtime license file is required for the control

  • The same ComponentOne product licenses must be valid for both projects

Configure Strong-Name Signing

In Visual Studio:

  1. Open Project Properties for the user control project.

  2. Open Project Properties for the main application project.

  3. On the Signing tab, configure both projects to use the same strong-name key file.

This approach is recommended when the user control is always deployed with a known application.

Option 2: Generate a Runtime License for the User Control

If strong-name signing is not possible, you can generate a runtime license file specifically for the user control.

Generate the Runtime License Using Visual Studio

  1. In Visual Studio, select

    Tools > MESCIUS > License Manager > Create Run-time License

  2. Select Custom as the project type.

  3. Under App Name, enter the full file name that combines:

    • The application name

    • The user control or library name

      Example:

      MyApplication.MyUserControl.dll

  4. Select any output location (you will move the file afterward).

  5. Under Serial Key Type, select the licensed product.

  6. Click Generate.

A runtime license file (for example, .gclicx) is generated.

Add the file to the Properties folder of the user control project and set its Build Action to Embedded Resource.

Generate the Runtime License Using the Command Line

# Windows
C:\ProgramData\GrapeCity\gclm\gclm.exe "<product-id>" -lc ./.gclicx "app-name.library-name.dll"
# Linux / macOS
gclm "<product-id>" -lc ./.gclicx "app-name.library-name.dll"

Where:

  • app-name is the application name

  • library-name is the user control or class library name

  • product-id is the ComponentOne product ID

Example:

C:\ProgramData\GrapeCity\gclm\gclm.exe "331cf6cd-b73c-429f-ba79-fa2f85eebd68" -lc ./.gclicx "MyApplication.MyUserControl.dll"

Option 3: Licensing a User Control for an Unknown Application

If the user control or class library will be used by unknown or third-party applications, and:

  • The application name is not known at build time, and

  • Strong-name signing cannot be used

Then a plugin license is required.

Generate a Runtime License for a Plugin

With an activated plugin license, generate a runtime license using only the library name.

Command Line

# Windows
C:\ProgramData\GrapeCity\gclm\gclm.exe "<product-id>" -lc ./.gclicx "MyUserControl.dll"
# Linux / macOS
gclm "<product-id>" -lc ./.gclicx "MyUserControl.dll"

Visual Studio

  1. Select Tools > MESCIUS > License Manager > Create Run-time License

  2. Select Custom

  3. Under App Name, enter the user control library name (for example, MyUserControl.dll)

  4. Select the Plugin licensed product

  5. Generate the license and embed it as a resource

To obtain a plugin license, contact our support team.

Some legacy workflows use older licensing tools. These scenarios are documented separately to avoid confusion with modern licensing flows.