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

Native chain - root serialization type

Hi

I cannot Run my UWP app in release mode with  ".NET Native tool chain" enabled 

It fails on the Load function :
        Stream str = readStream.AsStream();
         sfdiagram.Load(str);


Exception thrown: 'System.Runtime.Serialization.InvalidDataContractException' in System.Private.DataContractSerialization.dll
An exception of type 'System.Runtime.Serialization.InvalidDataContractException' occurred in System.Private.DataContractSerialization.dll but was not handled in user code
Additional information: Type 'Syncfusion.UI.Xaml.Diagram.DiagramElementViewModel' cannot be serialized, serialization code for the type is missing. Consult the SDK documentation for adding it as a root serialization type.

Visual Studio Enterprise 2015 Update 3
Syncfusion 14.3.0.49


Attachment: UWP_error_d56df799.zip

4 Replies

CM Charl Minnaar November 3, 2016 10:56 AM UTC

I managed to solved this issue with reflection


KR Keerthivasan Ramamoorthy Syncfusion Team November 4, 2016 10:11 AM UTC

Hi Charl, 
 
We are glad that you have fixed your issue. Please let us know if you need any other assistance. 
 
Regards, 
Keerthivasan R. 



AE Andreas Ermer September 15, 2017 03:15 PM UTC

Hi Charl Minnaar, could you please share how you solved your issue?



RA Ranjitha Amirthalingam Syncfusion Team September 18, 2017 12:17 PM UTC

Hi Andreas, 
 
The reported issue can be resolved by assigning the position as zero to the Stream before Loading. We have provided code example to represent this. Please refer to the code example as below. 
 
Code Example: 
System.IO.MemoryStream str = new System.IO.MemoryStream(); 
 
str.Position = 0; 
diagram.Load(str); 
 
//Here,diagram is the instance of SfDiagram. 


We hope that , Charl also resolved the issue as we described above. 
 
Regards, 
Ranjitha A. 


Loader.
Live Chat Icon For mobile
Up arrow icon