SyncFusion sfChart, sfPopupLayout does not work in release mode

I have an app that uses sfPopupLayout and also uses sfChart. They all work fine in debug mode but they throw an exception in Release mode. I get the following exception:


Exception thrown: 'System.NullReferenceException' in Syncfusion.SfPopupLayout.XForms.dll


I get a similar exception for sfChart as well



3 Replies

YP Yuvaraj Palanisamy Syncfusion Team August 31, 2021 04:50 PM UTC

Hi Sree Sundaram,

 
Greetings from Syncfusion. 

#SfChart:

We have analyzed your query and we have prepared the SfChart sample in Xamarin.Forms and it was working fine in release mode. Also, we have attached the test sample for your reference. Please find the sample from the below link. 

  
If still you are facing the problem, could you please revert us the modified sample with issue reproduced state which will be helpful to serve you better solution at the earliest. 

#SfPopuplayout: 

We have created a separate incident and updated the response for SfPopupLayout control in the below incident under your account. Kindly follow up the incident further details. 

Regards, 
Yuvaraj.



SS Sree Sundaram August 31, 2021 08:57 PM UTC

Thank you Yuvaraj. After adding the following lines in my UWP code (App.xaml.cs in OnLaunched event handler), I was able to make it work:


The new code goes between the following two lines:


rootFrame.NavigationFailed += OnNavigationFailed;

//Code goes here

                Xamarin.Forms.Forms.Init(e); //comment this one out and add the new version (see below) instead



                rootFrame.NavigationFailed += OnNavigationFailed;


                

                List<Assembly> assembliesToInclude = new List<Assembly>();


                //Now, add in all the assemblies your app uses

                assembliesToInclude.Add(typeof(Syncfusion.XForms.UWP.PopupLayout.SfPopupLayoutRenderer).GetTypeInfo().Assembly);

                assembliesToInclude.Add(typeof(WordDocument).GetTypeInfo().Assembly);

                assembliesToInclude.Add(typeof(Presentation).GetTypeInfo().Assembly);

                assembliesToInclude.Add(typeof(Syncfusion.SfChart.XForms.UWP.SfChartRenderer).GetTypeInfo().Assembly);

                assembliesToInclude.Add(typeof(Syncfusion.ListView.XForms.SfListView).GetTypeInfo().Assembly);


                //Also do this for all your other 3rd party libraries


                Xamarin.Forms.Forms.Init(e, assembliesToInclude);


                ///////

                //commented the line below but included the one above


                //Xamarin.Forms.Forms.Init(e);



YP Yuvaraj Palanisamy Syncfusion Team September 1, 2021 07:10 AM UTC

Hi Sree Sundaram, 
 
Thank you for your update. We are glad to know that the provided solution works at your end. 
 
Please let us know if you have any further assistance. 
 
Regards, 
Yuvaraj. 


Loader.
Up arrow icon