Completed
Last Updated: 23 Feb 2021 10:37 by ADMIN
Release R1 2021 SP2
Ken
Created on: 15 Feb 2021 08:11
Category: UI for WinForms
Type: Bug Report
0
ArgumentException: "Type not found..." when calling the ThemeResolutionService.LoadPackageResource method when loading the Fluent theme

After we just upgraded to 2021 SP, we are now getting several System.ArgumentExceptions when executing the following call to LoadPackageResource

Assembly assembly = Assembly.LoadFrom("STEAM.Common.dll");
 ThemeResolutionService.LoadPackageResource(assembly, "STEAM.Common.SpotlightOffice2013Light.tssp");

The errors are:

Exception thrown: 'System.ArgumentException' in Telerik.WinControls.dll
Type not found: Telerik.WinControls.UI.Docking.DockingGuidesElement. Please make sure you have reference to an assembly which contains type: Telerik.WinControls.UI.Docking.DockingGuidesElement

Exception thrown: 'System.ArgumentException' in Telerik.WinControls.dll
Type not found: Telerik.WinControls.UI.GridTableElement. Please make sure you have reference to an assembly which contains type: Telerik.WinControls.UI.GridTableElement

Exception thrown: 'System.ArgumentException' in Telerik.WinControls.dll
Type not found: Telerik.WinControls.UI.GridSearchCellElement. Please make sure you have reference to an assembly which contains type: Telerik.WinControls.UI.GridSearchCellElement

Exception thrown: 'System.ArgumentException' in Telerik.WinControls.dll
Type not found: Telerik.WinControls.UI.RadPivotGridElement. Please make sure you have reference to an assembly which contains type: Telerik.WinControls.UI.RadPivotGridElement

Exception thrown: 'System.ArgumentException' in Telerik.WinControls.dll
Type not found: Telerik.WinControls.UI.SchedulerMonthViewElement. Please make sure you have reference to an assembly which contains type: Telerik.WinControls.UI.SchedulerMonthViewElement

Exception thrown: 'System.ArgumentException' in Telerik.WinControls.dll
Type not found: Telerik.WinControls.UI.RadSpreadsheetElement. Please make sure you have reference to an assembly which contains type: Telerik.WinControls.UI.RadSpreadsheetElement

Exception thrown: 'System.ArgumentException' in Telerik.WinControls.dll
Type not found: Telerik.WinControls.UI.RadSpreadsheetElement. Please make sure you have reference to an assembly which contains type: Telerik.WinControls.UI.RadSpreadsheetElement

Exception thrown: 'System.ArgumentException' in Telerik.WinControls.dll
Type not found: Telerik.WinControls.UI.VirtualGridTableElement. Please make sure you have reference to an assembly which contains type: Telerik.WinControls.UI.VirtualGridTableElement

 

1 comment
ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 15 Feb 2021 08:26

Hi, Ken,

As of R1 2021 we have functionality for using Fluent theme as default: https://docs.telerik.com/devtools/winforms/styling-and-appearance/default-theme#fluent-theme-as-default 

This required the following change in our source code:

The Fluent theme is now a part of the Telerik.WinControls assembly and it is statically available everywhere just like the ControlDefault theme. As a result, it is no longer necessary to instantiate the FluentTheme type.

However, when loading the theme, several property settings throw handled exceptions. This will also be observed if you try loading the Fluent theme.

I understand that this may affect the initial load time in your project. That is why the possible solution that I can suggest is to force loading the types of the respective controls: 

public Form1()
        {
            InitializeComponent();

            new RadDock();
            new RadGridView();
            new RadPivotGrid();
            new RadScheduler();
            new RadSpreadsheet();

            Assembly assembly = Assembly.LoadFrom("STEAM.Common.dll");
            ThemeResolutionService.LoadPackageResource(assembly, "STEAM.Common.SpotlightOffice2013Light.tssp"); 
            pv.ThemeName = "SpotlightOffice2013Light";

            ThemeResolutionService.AllowAnimations = false;
        }

We will do our best to handle this case in an appropriate manner. Please excuse us for the inconvenience caused.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.