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

## Environment

<table>
	<tbody>
		<tr>
			<th scope="row">Product Version</th>
			<td>2025.2.521</td>
		</tr>
		<tr>
			<th scope="row">Product</th>
			<td>UI for WPF</td>
		</tr>
	</tbody>
</table>

## Description

The invalid/missing Telerik license key dialog is shown in addin (like Excel VSTO Add-in, Adobe and AutoCAD application addins and others) 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](https://www.telerik.com/account/your-licenses/license-keys) page.

```csharp
	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](https://www.telerik.com/products/wpf/documentation/installation/licensing/installing-license-key) where the `EvidenceAttribute` is added and then manually fetch the key from it.

```csharp
	public MyWPFUserControl()
	{		
  		var evidenceAttributes = typeof(MainWindow).Assembly.GetCustomAttributes().OfType<EvidenceAttribute>();
		foreach (var attribute in evidenceAttributes)
		{                
    		TelerikLicensing.Register(attribute.Value);
		}

		InitializeComponent();
	}
```

In version **1.6.7** of [TelerikLicensing](https://www.nuget.org/packages/Telerik.Licensing) a parameterless overload of the `TelerikLicensing.Register` was introduced. This will allow you to use the [approach with the TelerikLicense.cs file](https://www.telerik.com/products/wpf/documentation/installation/licensing/installing-license-key) 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](https://www.telerik.com/products/wpf/documentation/installation/licensing/installing-license-key). Also, this approach should be used even if you install Telerik using the associated NuGet packages.

```csharp
	public MyWPFUserControl()
	{
		TelerikLicensing.Register();
		InitializeComponent();
	}
```
