Unable to serialize

  • Thread starter Thread starter Ashutosh
  • Start date Start date
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
 
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
 
Back
Top