.NET MAUI Project - Could not set up parent class, due to: Invalid generic instantiation

1 Answer 855 Views
CheckBox
Nivesh
Top achievements
Rank 1
Nivesh asked on 02 Dec 2022, 12:30 PM | edited on 02 Dec 2022, 01:26 PM

Hi,

I created a project and referenced the following libraries:

I have imported namespace:

    xmlns:telerik="http://schemas.telerik.com/2022/xaml/maui"

and created a RadCheckBox like so:

<telerik:RadCheckBox x:Name="rcb" VerticalOptions="Center" />

When I run the application I get the following error:

 

Is there anything I am missing?

1 Answer, 1 is accepted

Sort by
1
Accepted
Lance | Senior Manager Technical Support
Telerik team
answered on 02 Dec 2022, 03:07 PM

Hi Nivesh,

The assembly reference dependency tree can be complex, we do not recommend manually trying to figure out all the individual DLLs you need to add to every separate platform target.

Solution

You should only use the Telerik.UI.for.Maui NuGet package and let the .NET tooling handle the proper assembly references for every platform.

Take these steps:

1. Remove all the Telerik DLL references from your project

2. Right-click on the project and select "Manage NuGet Packages"

3. Select the Telerik server for the package source (or the "All" source) and search for "Telerik.UI.for.Maui" and install it

Telerik NuGet Server Notes

Result

Once you're done installing it, you will now see the Telerik package reference in each target platform's 

Now you can define and use the Telerik namespace in your views:

Important Note

If you are trying to use this in a separate .NET class library which does not reference Microsoft .NET MAUI (i.e. <UseMaui> in the csproj), this will not work because we do not support this configuration. due to the fact that Telerik UI for MAUI has a dependency on Microsoft .NET MAUI.

That being said, if you really need to use DLLs, and the project is a compatible .NET MAUI type, you can find the platform-specific binaries in the C:\Program Files (x86)\Progress\Telerik UI for .NET MAUI 4.0.0\Binaries folder. However, if you use them, you are also responsible for making sure to manually locate and install all of the dependencies. This is an arduous and troublesome task because you need to manually install all the upstream packages, too. If you would like to know what those are, you can crack open the Telerik.UI.for.Maui.4.0.0.nupkg file and read the embedded .nuspec file for the dependencies list.

Regards,
Lance | Manager Technical Support
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
CheckBox
Asked by
Nivesh
Top achievements
Rank 1
Answers by
Lance | Senior Manager Technical Support
Telerik team
Share this question
or