# License User Controls

## Content

.NET allows creation of user controls and class libraries, reusable components that can be built in one project and consumed by other applications.
When a ComponentOne control is used within a user control or class library, the final application must be properly licensed. In certain scenarios, the user control or library must also include its own runtime license to prevent licensing errors at runtime.
This topic describes the supported licensing approaches for both SA3 and GCLM:

* **MESCIUS License Manager** → <span class="code" spellcheck="false" data-prosemirror-content-type="mark" data-prosemirror-mark-name="code">.sa3licx</span>
* **GCLM** → <span class="code" spellcheck="false" data-prosemirror-content-type="mark" data-prosemirror-mark-name="code">.gclicx</span>

See: [What is the difference between SA3 and GCLM?](/componentone/docs/license/online-license/faqs#q:-what-is-the-difference-between-sa3-and-gclm?)

## Choose the Appropriate Licensing Approach

Use the table below to determine the correct approach:

| <span class="resizer-hover-zone">Scenario</span> | <span class="resizer-hover-zone">Recommended Approach</span> |
| -------- | -------------------- |
| <span class="resizer-hover-zone">User control is always used by a known application</span> | <span class="resizer-hover-zone">Strong-name signing</span> |
| <span class="resizer-hover-zone">Application name is known at build time</span> | <span class="resizer-hover-zone">Generate runtime license for the user control</span> |
| <span class="resizer-hover-zone">Application name is unknown (plugin scenario)</span> | <span class="resizer-hover-zone">Plugin licensing</span> |

## Option 1: Use Strong-Name Signing

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

* The application’s runtime license is shared with the user control
* No separate runtime license file is required
* The same ComponentOne product licenses must be valid for both projects

This approach is recommended when the user control is always deployed with a known application.
**Configure Strong-Name Signing**
In Visual Studio:
1 . Open **Project Properties** for both:
\* User control project
\* Main application project
2 . Go to the **Signing** tab
3 . Enable signing and select the **same strong-name key file**
After building on an activated machine:

* **MESCIUS License Manager**: <span class="code" spellcheck="false" data-prosemirror-content-type="mark" data-prosemirror-mark-name="code">.sa3licx</span> is generated and embedded
* **GCLM**: <span class="code" spellcheck="false" data-prosemirror-content-type="mark" data-prosemirror-mark-name="code">.gclicx</span> is generated and embedded

The user control automatically uses the application license at runtime.

## Option 2: Generate a Runtime License for the User Control

Use this approach when:

* Strong-name signing cannot be used
* The application name is known at build time

A runtime license must be generated for the user control using a combined name:

```auto
<ApplicationName>.<LibraryName>.dll
```

Example:

```auto
MyApplication.MyUserControl.dll
```

### Generate Runtime License Using Visual Studio

#### MESCIUS License Manager

1 . Go to:

```auto
Tools > MESCIUS > MESCIUS License Manager
```

2 . Click **Create RunTime License**
3 . Select **Custom**
4 . Enter:

```auto
MyApplication.MyUserControl.dll
```

5 . Select the licensed product
6\. Generate the license
Output:

```auto
.sa3licx
```

#### GCLM

1 . Go to:

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

2 . Select **Custom**
3\. Enter:

```auto
MyApplication.MyUserControl.dll
```

4 . Select the licensed product
5\. Generate the license
Output:

```auto
.gclicx
```

### Embed the Runtime License

1 . Add the generated file to the user control project (typically under **Properties**)
2\. Set:

```auto
Build Action = Embedded Resource
```

### Generate Runtime License Using Command Line

#### MESCIUS License Manager (SA3 Client)

```auto
sa3client "<product-id>" lc -k "<serial-key>" -t "<app-name>" -o "<output-file>"
```

**Parameters:**

* `-k` → Serial Key
* `-t` → The application name (e.g., "MyApplication.MyUserControl.dll")
* `-o` → Output path and file name (e.g., "C:\\Temp\\MyUserControl.sa3licx")

#### GCLM

**Windows**

```auto
C:\ProgramData\GrapeCity\gclm\gclm.exe "<product-id>" -lc ./.gclicx "MyApplication.MyUserControl.dll"
```

**Linux / macOS**

```auto
gclm "<product-id>" -lc ./.gclicx "MyApplication.MyUserControl.dll"
```

## Option 3: Licensing for Unknown Applications (Plugin Scenario)

Use this approach when:

* The user control is used by unknown or third-party applications
* The calling application name is not known at build time
* Strong-name signing cannot be used

A special plugin license is required to build re-usable components for unknown applications. To obtain a plugin license, contact our **[support team](https://developer.mescius.com/support/contact).**
If you have a plugin license, you can use it as a normal developer license on any User Control or Class Library. In most cases, you will not need to manually generate the runtime license. A runtime license can be generated manually following the steps below.

### Generate Plugin Runtime License

In this case, generate the license using only the library name:

```auto
MyUserControl.dll
```

### Command Line

#### MESCIUS License Manager

```auto
sa3client "<product-id>" lc -k "<serial-key>" -t "<app-name>" -o "<output-file>"
```

#### GCLM

**Windows**

```auto
C:\ProgramData\GrapeCity\gclm\gclm.exe "<product-id>" -lc ./.gclicx "MyUserControl.dll"
```

**Linux / macOS**

```auto
gclm "<product-id>" -lc ./.gclicx "MyUserControl.dll"
```

### Visual Studio

1 . Go to:

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

2 . Select **Custom**
3\. Enter:

```auto
MyUserControl.dll
```

4 . Select the **plugin-licensed product**
5\. Generate the license
6\. Add the file to the project and set:

```auto
Build Action = Embedded Resource
```


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