New to Telerik UI for WPF? Download free 30-day trial

Telerik License Not Found Dialog Shown When UI for WPF Used in Addin Project

Environment

Product Version 2025.2.521
Product UI for WPF

Description

The invalid/missing Telerik license key dialog is shown in addin (like Excel VSTO Add-in) projects even when a valid license is installed.

Solution

This happens because there is no proper main window and application context, which means that the licensing mechanism cannot get evaluated as expected. To resolve this, use the TelerikLicensing.Register static method with your license script key, which can be downloaded from the License Keys page.

    public MyWPFUserControl()
    {
        TelerikLicensing.Register("your-script-key");
        InitializeComponent();
    }

If you prefer to avoid setting your script key in the C# code, you can use the approach with the TelerikLicense.cs file where the EvidenceAttribute is added and then manually fetch the key from it.

    public MyWPFUserControl()
    {       
        var evidenceAttr = typeof(MainWindow).Assembly.GetCustomAttribute<Telerik.Licensing.EvidenceAttribute>();
        var key = evidenceAttr?.Value ?? "";
        TelerikLicensing.Register(key);

        InitializeComponent();
    }

In version 1.6.7 of TelerikLicensing a parameterless overload of the TelerikLicensing.Register was introduced. This will allow you to use the approach with the TelerikLicense.cs file and call the register method without passing the script key in the C# code. Note that for this to work you will still need to add the TelerikLicense.cs file.

    public MyWPFUserControl()
    {
        TelerikLicensing.Register();
        InitializeComponent();
    }
In this article