Unplanned
Last Updated: 04 Apr 2025 06:24 by Martin Ivanov
Martin Ivanov
Created on: 04 Apr 2025 06:24
Category: UI for WPF
Type: Bug Report
0
Licensing: Cannot resolve dependency to assembly Telerik.Licensing.Runtime error, in a class library project that doesn't use any Telerik code

A compilation error occurs in a class library project which doesn't use any Telerik code, but it is referenced in another project which installs the Telerik.Licensing NuGet package. The error reproduces only if the class library project contains .xaml files.

The error message from the class library project is the following:

C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.WinFx.targets(268,9): error MC1000: Unknown build error, 'Cannot resolve dependency to assembly 'Telerik.Licensing.Runtime, Version=1.4.6.0, Culture=neutral, PublicKeyToken=keyhere' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.'

To workaround this, you can add assembly references to the Telerik dlls in the main project (including Telerik.Licensing.Runtime), instead of using NuGet packages.

Alternatively, you can install the Telerik.Licensing NuGet package also in the class library.

<ItemGroup>
	<PackageReference Include="Telerik.Licensing" Version="1.4.*" />
</ItemGroup>

Note that with this approach you will see a message in the output that no license is installed, even if you have one. However, for now (versions from 1.4.6 to 1.4.12, which is the latest at the moment of writting this post), the error won't apply any compile or runtime restrictions on the UI or the functionality.

 

0 comments