Adding Telerik Reporting License Key in a Managed C++/CLI Project
Environment
| Product | Progress® Telerik® Reporting |
| Version | 19.0.25.211+ |
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 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
- Go to the License Keys page in your Telerik account.
- Click View Script Keys.
- From the dropdown, select Progress® Telerik® Reporting.
- 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:
using namespace Telerik::Licensing;
[assembly:EvidenceAttribute("YOUR_LICENSE_KEY_HERE")];
Replace YOUR_LICENSE_KEY_HERE with the raw key string obtained in Step 1.
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:
<ClCompile Include="TelerikLicense.cpp" />
Step 5: Build and Verify
Rebuild the project. The license warnings and watermarks should no longer appear.
Do not publish the license key in publicly accessible repositories. The key is personal and tied to your Telerik account.