Page 1 of 1

Serialization and Deserialization Problem

Posted: Fri Apr 07, 2006 5:03 pm
by 9640767
I faced to problem. Firstly I used trial teechart in my application (vesion 2.0.2040.15118). I saved chart into file using next code

protected Steema.TeeChart.TChart chart;
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
info.AddValue("chart", chart);
}

After that I uninstalled trial version and installed license teechart (version 2.0.2179.21172). Than I rebuilt my application using new teechart, then I tried to restore saved before chart.

fileStream = File.Open(fileName, FileMode.Open, FileAccess.ReadWrite);
SoapFormatter serializer = new SoapFormatter();
Some_type some_type = (Some_type)serializer.Deserialize(fileStream);

there is an error!!!
"Parse Error, no assembly associated with Xml key a11:http://schemas.microsoft.com/clr/nsasse ... 276c77bdb7 TChart"
As I understand it has happened due to the fact the application cann't
find required assembly.

Please, any idea to resolve this problem.

Thanks.

a little more

Posted: Sat Apr 08, 2006 12:58 pm
by 9640767
I've done some research and found out that two version TeeChart.dll have defferent implementation DeserializeFrom method, namely

old version
....
else if (descriptor3.PropertyType == typeof(StringList))
{
StringList list2 = new StringList(((Array) entry2.Value).Length);
list2.AddRange((Array) entry2.Value);
if (list2.Count > 0)
{
descriptor3.SetValue(obj2, list2);
}
}
....

and new one

......
else if (descriptor3.PropertyType == typeof(StringList))
{
StringList list2 = new StringList(((StringList) entry2.Value).Count);
list2.AddRange((StringList) entry2.Value);
if (list2.Count > 0)
{
descriptor3.SetValue(obj2, list2);
}
}
.....

May be it is a bug. But I don't know how to resolve it.

Posted: Mon Apr 10, 2006 10:19 am
by narcis
Hello,

Have you tried TeeChart native file exporting and importing as told in Tutorial 12 - Exporting and Importing Charts? TeeChart tutorials can be found at its program group.