Unable to serialize


A

Ashutosh

Hi,
I have these 2 classes, I can serialize them using Binary Serializer but
not with XML serializer. XmlSerializer constructor throws execption
"There was an error reflecting type 'AB.TBSettings'."

Any idea what is wrong here??

[Serializable]
public class Applications
{
public string Path;
public string DisplayName;
[OptionalField]
public string Arguments;
}
[Serializable]
public class TBSettings
{
public Hashtable credentials = new Hashtable();
//public OrderedDictionary applications = new OrderedDictionary();
[XmlArray]
public Applications[] applications = new Applications[0];
//public
public Point MainFromLocation = new Point(0, 0);

[NonSerialized]
[XmlIgnore]
private static TBSettings theObj = null;

public TBSettings()
{

}
}

Thanks & Regards,
Ashutosh
 
Ad

Advertisements

Ad

Advertisements

A

Ashutosh

Thanks!
Take a look here:

http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!114.entry
XmlSerialization with IDictionary and CollectionBase Objects



Hi,
I have these 2 classes, I can serialize them using Binary Serializer but
not with XML serializer. XmlSerializer constructor throws execption "There
was an error reflecting type 'AB.TBSettings'."

Any idea what is wrong here??

[Serializable]
public class Applications
{
public string Path;
public string DisplayName;
[OptionalField]
public string Arguments;
}
[Serializable]
public class TBSettings
{
public Hashtable credentials = new Hashtable();
//public OrderedDictionary applications = new OrderedDictionary();
[XmlArray]
public Applications[] applications = new Applications[0];
//public
public Point MainFromLocation = new Point(0, 0);

[NonSerialized]
[XmlIgnore]
private static TBSettings theObj = null;

public TBSettings()
{
}
}

Thanks & Regards,
Ashutosh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top