Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic SaveToXML and LoadFromXML troubles (Read 1689 times)
Ismail
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 9
Joined: Dec 11th, 2020
SaveToXML and LoadFromXML troubles
Dec 16th, 2020 at 8:42pm
Print Post  
I'd like to save my flowchart data to an XML file and I use SaveToXML using an Assembly name Program2020 and Version 2020.0.0.0

This works fine with LoadFromXML, but if I change my assembly name to Program2021 and Version to 2021.0.0.0, and try to load the file using LoadFromXML, I get the following error:

System.Runtime.Serialization.SerializationException: 'Unable to find assembly 'Program2020, Version=2020.0.0.0, Culture=neutral, PublicKeyToken=null'.'

Is there a way to make the XML file Assembly and Version independent? Sad

Edit: I can't seem to find Assembly name and version in the XML file. I am using node tags filled with properties. The tags seem to be encrypted in the XML. Are the assembly and version  embedded in the tag? If so, is there a way to control/change them?
« Last Edit: Dec 17th, 2020 at 12:01am by Ismail »  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3153
Joined: Oct 19th, 2005
Re: SaveToXML and LoadFromXML troubles
Reply #1 - Dec 17th, 2020 at 9:37am
Print Post  
Hi,

Try setting diagram.SerializationBinder to an instance that handles your renamed assemblies. You can find some sample binders here -

https://mindfusion.eu/Forum/YaBB.pl?num=1486395394/4#4
https://mindfusion.eu/Forum/YaBB.pl?num=1486395394/15#15

Alternatively, handle SerializeTag and DeserializeTag events to store your tag data as XML elements.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint