# Adding Telerik Reporting License Key in a Managed C++/CLI Project

## Environment

<table>
	<tbody>
		<tr>
			<td>Product</td>
			<td>Progress® Telerik® Reporting</td>
		</tr>
        <tr>
			<td>Version</td>
			<td>19.0.25.211+</td>
		</tr>
	</tbody>
</table>

## Description

I use Telerik Reporting in a managed C++/CLI project. My project contains `.cpp` and `.h` files and a `.vcxproj` project file instead of a `.csproj`.
The [standard license key setup](https://www.telerik.com/products/reporting/documentation/licensing/setting-up-your-telerik-reporting-license-key) does not activate the product, and I see license-related warnings and watermarks.

How do I add the Telerik Reporting license key to a managed C++/CLI project?

## Solution

To activate Telerik Reporting in a managed C++/CLI project, add the license key as an assembly-level attribute in a `.cpp` file and reference the licensing assembly manually.

### Step 1: Obtain the License Key

1. Go to the [License Keys](https://www.telerik.com/account/your-licenses/license-keys) page in your Telerik account.
2. Click **View Script Keys**.
3. From the dropdown, select **Progress® Telerik® Reporting**.
4. The dialog displays code snippets in C# and VB.NET. Copy only the raw key string (the `"eyJhbGciOiJSUzI1..."` value).

### Step 2: Reference the Licensing Assembly

Make sure your project references `Telerik.Licensing.Runtime.dll`, which you should get from the **Reporting installation directory -> Bin**, as that would ensure that the version of the assembly is correct.

### Step 3: Add the License Key File

Create a new file named `TelerikLicense.cpp` in your project with the following content:

```cpp
using namespace Telerik::Licensing;

[assembly:EvidenceAttribute("YOUR_LICENSE_KEY_HERE")];
```

Replace `YOUR_LICENSE_KEY_HERE` with the raw key string obtained in [Step 1](https://www.telerik.com/products/reporting/documentation/knowledge-base/license-key-managed-cpp-project#step-1-obtain-the-license-key).

### Step 4: Include the File in the Project

Open your `.vcxproj` file and add the following line inside an `<ItemGroup>` that contains other `<ClCompile>` entries:

```XML
<ClCompile Include="TelerikLicense.cpp" />
```

### Step 5: Build and Verify

Rebuild the project. The license warnings and watermarks should no longer appear.

> important Do **not** publish the license key in publicly accessible repositories. The key is personal and tied to your Telerik account.

## See Also

* [Setting Up Your Telerik Reporting License Key](https://www.telerik.com/products/reporting/documentation/licensing/setting-up-your-telerik-reporting-license-key)
* [License Errors and Warnings](https://www.telerik.com/products/reporting/documentation/licensing/license-errors-and-warnings)
