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

Chart not rendered in UWP Release mode

I tried to use the SfChart targeting Android and UWP. All works great in Debug mode, but in Release mode the chart is not displayed for UWP. I tried both ARM and x86.
I used the GettingStartedDemo (which was initially targeting Android, iOS and Windows Phone 8.0) but I extended it with a UWP project.
I referenced Syncfusion.SfChart.UWP, Syncfusion.SfChart.XForms and Syncfusion.SfChart.XForms.UWP in the UWP project and I also added the new SfChartRenderer(); in the MainPage() constructor.
The Debug build compiled and run well, but the Release built shows the following warnings:

2>G:\My Documents\Visual Studio 2015\Projects\Chart_GettingStarted\GettingStartedDemo.UWP\sg.exe : warning : SG0002 : Cannot generate serialization code for type 'Syncfusion.UI.Xaml.Charts.SerializableSfChart'
2>G:\My Documents\Visual Studio 2015\Projects\Chart_GettingStarted\GettingStartedDemo.UWP\sg.exe : warning : SG0002 : Cannot generate serialization code for type 'Syncfusion.UI.Xaml.Charts.SerializableWatermark'
etc....

and when running the code, the chart is not displayed

5 Replies

DA Devi Aruna Maharasi Murugan Syncfusion Team November 7, 2016 09:48 AM UTC

Hi Paul, 
  
Thanks for contacting Syncfusion Support. 
  
In order to work our Syncfusion components (third party components) in release mode with enabling .Net Native tool chain, we have to include Renderer type assembly as like in the below code snippet.    
  
App.Xaml.cs 
 
List<Assembly> assembliesToInclude = new List<Assembly>(); 
 
assembliesToInclude.Add(typeof(Syncfusion.SfChart.XForms.UWP.SfChartRenderer).GetTypeInfo().Assembly); 
 
Xamarin.Forms.Forms.Init(e , assembliesToInclude); 
 
  
  
We have prepared a demo sample for your reference and it can be downloaded from below link, 
  
Sample: XamarinDemo 
  
Regards, 
Devi 






PV Paul van der stap November 7, 2016 02:22 PM UTC

Thanks Devi,

This worked for me.

Paul


DA Devi Aruna Maharasi Murugan Syncfusion Team November 8, 2016 03:33 AM UTC

Hi Paul, 
  
Thanks for your update. 
  
Please let us know, if you need any further assistance. 
  
Regards, 
Devi 



ZU Zulu September 15, 2021 08:59 AM UTC

Is there some solution for a UWP C# desktop app? Not Xamarin



YP Yuvaraj Palanisamy Syncfusion Team September 16, 2021 02:27 PM UTC

Hi Zulu, 
 
Greetings from Syncfusion. 
 
We have analyzed your query and we have checked the reported problem “Chart does not rendered in release mode” it was working fine at our end. Also, we have attached the test sample for your reference, please find the test sample from the below link. 
 
 
Could you please check the above sample and if still you are facing the problem, please share us the following details. 
·       Syncfusion package version  
·       Machine configuration details(Visual studio version, Deployment target version) 
·       Additional project settings like enable Native tool chain 
·       Chart code snippet 
 
If possible, please share the modified sample with issue reproduced state, which will be helpful for us to provide the better solution at the earliest. 
 
Regards, 
Yuvaraj. 


Loader.
Live Chat Icon For mobile
Up arrow icon