Serialization and Deserialization Problem

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
nikitenko@dataart.com
Newbie
Newbie
Posts: 21
Joined: Mon Mar 27, 2006 12:00 am

Serialization and Deserialization Problem

Post by nikitenko@dataart.com » Fri Apr 07, 2006 5:03 pm

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.

nikitenko@dataart.com
Newbie
Newbie
Posts: 21
Joined: Mon Mar 27, 2006 12:00 am

a little more

Post by nikitenko@dataart.com » Sat Apr 08, 2006 12:58 pm

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.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Apr 10, 2006 10:19 am

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply