Completed
Last Updated: 04 Feb 2021 14:34 by RoGro
Release R1 2021 SP1
RoGro
Created on: 01 Feb 2021 09:36
Category: DateTimePicker
Type: Bug Report
0
After Telerik update, our designer throws NullReferenceException during instanciating a Telerik.WinControls.UI.RadDateTimePicker

After the installation of the latest update (Version 2021.1.122.40) for "Telerik UI for WinForms", our Formulardesigner throws a NullReferenceException during instanciating a Telerik.WinControls.UI.RadDateTimePicker.

Stacktrace:

   bei Telerik.WinControls.UI.Design.DesignTimeThemeSettingsService.GetActiveProject(_DTE dte)
   bei Telerik.WinControls.UI.Design.DesignTimeThemeSettingsService.get_ActiveProject()
   bei Telerik.WinControls.UI.Design.DesignTimeThemeSettingsService.get_Configuration()
   bei Telerik.WinControls.UI.Design.DesignTimeThemeSettingsService.Start()
   bei Telerik.WinControls.UI.Design.RadControlDesignerLite.Initialize(IComponent component)
   bei System.ComponentModel.Design.DesignerHost.AddToContainerPostProcess(IComponent component, String name, IContainer containerToAddTo)
   bei System.ComponentModel.Design.DesignerHost.PerformAdd(IComponent component, String name)
   bei System.ComponentModel.Design.DesignerHost.System.ComponentModel.Design.IDesignerHost.CreateComponent(Type componentType, String name)
   bei Formulardesigner.Loader.FormularDesignerLoader.CreateDesignerControl(IDesignerLoaderHost host, Control controlDefinition, PersistedSettings persistedSettings)

What is changed and how can we solve that?

6 comments
RoGro
Posted on: 04 Feb 2021 14:34

Hello Telerik team,

thank you very much, for the fast solution. After installing the Version 2021.1.204 everything is working again.

Best regards,

Robert.

ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 02 Feb 2021 07:26

Hello, Robert, 

The provided detailed explanation is greatly appreciated. It helped me a lot to understand better your scenario.

After investigating further the latest changes, I have noticed that we introduced improvements regarding the default design time theme: https://docs.telerik.com/devtools/winforms/styling-and-appearance/default-theme 

This introduced functionality relies on the returned value from the DesignTimeThemeSettingsService.GetActiveProject method which is null in your case outside VS.

I have logged it in our feedback portal by making this thread public on your behalf. You can track its progress, subscribe for status changes and add your comments on the following link - feedback item.

I have also updated your Telerik points.

Due to the specificity of the issue, I am unable to suggest an appropriate solution. We will do our best to introduce a fix as soon as possible in the upcoming service pack or latest internal builds.

Please excuse us for the inconvenience caused. If you need any further assistance please don't hesitate to contact me. 

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/.

RoGro
Posted on: 01 Feb 2021 15:36

Hello Dess,

the error isn't happening during the Design in VS. Our Software is a designer, which uses the .Net ComponentModel. The Software is still working and compiling.

I've done additional tests and now know more. First some explanations.

Our base form on the design surface is a WinForm-Form not a RadForm. In our toolbox on the left side, we have two Telerik-controls and a lot of WinForm-controls. When I'm starting our Design-Software from VS, then it compiles and starts without any problems. So I don't think, that we have a problem with old DLL's.

When we're loading a stored design from the disk, then the controls on the surface are created with the Method CreateComponent from the interface IDesignerHost. This ist still working well. Only when it's coming to one of the two Telerik-controls (It's not the first control of the loaded design),then I'm getting the exception from my first post. On Friday, before I've done the Telerik update, there has been no exception.

And now it's getting real strange. The exception only occurs one time! When I'm starting the loading of the stored formular again. Then it works fine. The exception only is thrown on the first call of the Method CreateComponent for the RadDateTimePicker, so I think, that the first call has thrown the exception, but also has initialized "something", so that the next calls are working fine. This "something" should have something to do with the DesignTimeThemeSettingService.

There's a second Problem and I think it relies on the same reason. When I'm starting our Designer with a new form, then I can add labels and all other WinForm-controls. But when I add a RadDateTimePicker, then nothing happens. There is no new control on the surface. The second try with a RadDateTimePicker is working fine. I'm not getting an exception and think, that it's thrown, but caught by the ComponentModel.

 

Regards,

Robert, Developer

CRP Informationssysteme GmbH

ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 01 Feb 2021 13:47

Hello, Robert, 

I suppose that "Formular" is the RadForm in your project to which you add a RadDateTimePicker. Please correct me if my assumption is wrong. We haven't introduced any particular changes to the RadDateTimePicker control and its initialization. Hence, I believe that it is not related to a specific control but to the overall design time experience. 

According to the initially provided stack trace, it seems to be a design time issue. The end users are not expected to open the form's designer but use the application at run time. Hence, they are not expected to face this undesired behavior. 

Such design time issues may occur in case you have some old Telerik versions left in GAC. Our designers in the full .NET Framework depend on the installed version in the Global Assembly Cache. The following KB article demonstrates a sample approach how to examine whether old versions exist in the GAC and remove them: https://docs.telerik.com/devtools/winforms/knowledge-base/examine-the-gac 

I would recommend you for the further Telerik upgrades to uninstall any existing versions first and then install only the latest version. Thus, after referring the new assemblies and deleting the license file, building the project is expected to be successful.

In case you are still experiencing any further difficulties, it would be greatly appreciated if you can provide a sample project demonstrating the problem you are facing. Thus, we would be able to investigate the precise case and provide further assistance. Thank you in advance. 

Should you have further questions please let me know.

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/.

RoGro
Posted on: 01 Feb 2021 11:23

Hello Dess,

that hasn't solved it. All references and the licenses.licx has been correct and renewing it hasn' helped.

I've solved it, but I don' know why it's working now. The error occured during the loading process af a formular (It's a "Formular-Designer). So a tried to start with a new formular and added a RadDateTimePicker to the formular and it worked. After that I've saved this small formular and loaded it and it worked. Then I've again loaded the first formular, where the error has occured and it has been loaded correctly. Very strange.

Have you added some new configurations with the new version, which have been intialized during the adding of the DateTimePicker? But where? I'm not very lucky with this and am hoping, that this error won't occure at our customers.

 

Regards,

Robert, Developer

CRP Informationssysteme GmbH

ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 01 Feb 2021 09:51

Hello, Robert,

According to the provided information, it seems that you are using the full .NET Framework (4.6.1), not .NET Core or .NET 5 where the designers target a specific version of the WinForms Designer: https://docs.telerik.com/devtools/winforms/core/design-time  

That is why I suppose that your project targets the old version of the Telerik UI for WinForms suite. I would like to ask you to carefully check the references to all Telerik controls in your project and make sure that they are the same version considering the suffix as well (.20 or .40). Better yet, you can remove all references and add them anew by using the DLLs from your fresh installation. Delete the license.licx file. After that, you should rebuild your project, close Visual Studio and open it again to make sure that no references are kept in the memory by Visual Studio. 

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

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/.