We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

SyncFusion screwed my whole application in the designer

My application was well as I have been using SF controls on my application. All of a sudden when I run the application I started getting Null Reference Exceptions on SyncFusion components only. I am using VS.2019.
First it was a TextBoxExt, the exception was thrown when the application starts and it blows up in the Form's InitializeComponent() method near the top where the SyncFusion component is instantiated:
private void InitializeComponent()
{
this.components = new System.CompoentModel.Container();
:
this.textBoxTitle = new Syncfusion.Windows.Forms.Tools.TextBoxExt(); // <----- exception thrown right here
:
}
The details are these:
Exception thrown: 'System.NullReferenceException' in Syncfusion.Shared.Base.dll
An unhandled exception of type 'System.NullReferenceException' occurred in Syncfusion.Shared.Base.dll
Referencia a objeto no establecida como instancia de un objeto.

That was in one form. So, figuring it was a glitch of some kind I proceeded to delete the offending instance on the designer (it had always been fine!) and dropped it again on the designer. Recompiled and run. To my dismay, it was now throwing the same error on ANOTHER Syncfusion component in a different User Control.
For what I can see all is well in the designer. The variable is defined (Designer.cs), the initializations are there but for some reason Shared.Base.dll fails to instantiate the Syncfusion control.

6 Replies

JP Jagadeesan Pichaimuthu Syncfusion Team May 30, 2019 01:19 PM UTC

Hi Emilio, 
  
Thank for contacting Syncfusion support. 
  
Based on provide information we are unable to reproduce the reported issue at our end. May be our issue reproducing scenario may differ from yours. So please provide replication steps or issue reproducing video or stack trace for the reported issue and if possible please provide your issue reproducible application this would helpful us to analyze and resolve your issue at earliest. 
  
Regards, 
Jagadeesan


EG Emilio Grimaldo May 30, 2019 03:58 PM UTC

Below is the Stack Trace that you asked. It is always on SyncFusion components and as I mentioned it happened all of a sudden. However, your question triggered me thinking which other "innocuous" changes may have triggered these faults. Well, as it turns out I had added the following line to my Program.cs before instantiating the main form:

SkinManager.ApplicationVisualTheme = Properties.Settings.Default.Theme;

And that Theme is defined in my application settings and it is set to "PurpleRain" which is the exact same name of the theme DLL I created with Theme Studio and referenced in my application. The theme is properly applied to the few components that are themeable (unfortunately it does not work for regular WinForms components). So, I figured the only change was the addition to the call to SkinManager.ApplicationVisualTheme property and voilá! when I remove the call to the SkinManager, the NullReferenceException goes away and the PurpleRain theme is (still) applied to the NavigationDrawer and a few other SF components where I programmatically set the ThemeName property. The documentation led me to believe I could save myself from manually setting the ThemeName on each and every control by simply using the Skin Manager but that approach seems to be flawed because using the Skin Manager to set the Application Visual Theme breaks everything! if I leave SkinManager.LoadAssembly(typeof(PurpleRain).Assembly) no errors are produced and the theme is available BUT as I said, adding a call to ApplicationVisualTheme causes random Null Reference Exceptions on SF components during InitializeComponent.

Stack Trace

System.NullReferenceException
  HResult=0x80004003
  Message=Referencia a objeto no establecida como instancia de un objeto.
  Source=Syncfusion.Shared.Base
  StackTrace:
   at Syncfusion.Windows.Forms.Tools.AutoLabel.ApplyControlTheme(String themeName)
   at Syncfusion.Windows.Forms.Tools.AutoLabel.set_ThemeName(String value)
   at Syncfusion.Windows.Forms.Tools.AutoLabel.Syncfusion.Windows.Forms.IVisualStyle.set_VisualTheme(String value)
   at Syncfusion.Windows.Forms.SkinManager.ApplyThemeToControls(Control control, String visualStyle)
   at Syncfusion.Windows.Forms.SkinManager.SetVisualStyle(Control control, String visualStyle)
   at Syncfusion.Windows.Forms.Tools.AutoLabel..ctor()
   at MyNovel.UI.Views.Viewlets.SimpleRichEditorViewlet.InitializeComponent() in C:\Users\Didi\source\repos\MyNovel\MyNovel.UI\Views\Viewlets\SimpleRichEditorViewlet.Designer.cs:line 43
   at MyNovel.UI.Views.Viewlets.SimpleRichEditorViewlet..ctor() in C:\Users\Didi\source\repos\MyNovel\MyNovel.UI\Views\Viewlets\SimpleRichEditorViewlet.cs:line 50
   at MyNovel.UI.Views.Viewlets.FreeRichTextViewlet.InitializeComponent() in C:\Users\Didi\source\repos\MyNovel\MyNovel.UI\Views\Viewlets\FreeRichTextViewlet.Designer.cs:line 38
   at MyNovel.UI.Views.Viewlets.FreeRichTextViewlet..ctor() in C:\Users\Didi\source\repos\MyNovel\MyNovel.UI\Views\Viewlets\FreeRichTextViewlet.cs:line 26
   at MyNovel.UI.Views.NovelixView.InitializeComponent() in C:\Users\Didi\source\repos\MyNovel\MyNovel.UI\Views\NovelixView.Designer.cs:line 41
   at MyNovel.UI.Views.NovelixView..ctor() in C:\Users\Didi\source\repos\MyNovel\MyNovel.UI\Views\NovelixView.cs:line 27
   at MyNovel.UI.Program.Main() in C:\Users\Didi\source\repos\MyNovel\MyNovel.UI\Program.cs:line 27




SP Subburaj Pandian Veluchamy Syncfusion Team May 31, 2019 02:23 PM UTC

Hi Emilio, 
 
Thank you for contacting Syncfusion support. 
  
Currently, we are analyzing your reported query. We will validate and update you the details on June 4, 2019. We appreciate your patience until then. 
 
Regards,  
Subburaj Pandian V  
 



SS Susmitha Sundar Syncfusion Team June 4, 2019 02:16 PM UTC

Hi Emilio, 

Based on your provided information, We have analyzed your reported Null reference exception. We were not able to reproduce your reported issue. We have prepared sample for your reference, you can download this from below location, 


Based on the provided stack trace, we have checked our source and there is no possibilities for throwing NullException. To avoid further delay, we would like to set up a web meeting to check the reported problem in your environment and try to provide the solution at earliest. Would you please let us know of your availability for this? Our team will make every effort to have this scheduled on a date and time per your convenience. 

Regards, 
Susmitha S 



JP Joseph Petric June 11, 2019 11:53 PM UTC

My install started doing this after an update. I ended up removing the Syncfusion references from my solution, then manually re-added them.


SP Subburaj Pandian Veluchamy Syncfusion Team June 12, 2019 09:30 AM UTC

Hi Emilio, 
 
Thank you for the update. We are happy that the mentioned issue resolved at your end. 
  
Please get in touch with us if you would require further assistance in future. 
 
Regards,
Subburaj Pandian V 


Loader.
Live Chat Icon For mobile
Up arrow icon