[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Ashutosh

10/20/2008 4:00:00 PM

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
2 Answers

sloan

10/20/2008 4:34:00 PM

0

Take a look here:

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



"Ashutosh" <smbs-msdn@nospam.nospam> wrote in message
news:%23T8ibzsMJHA.4380@TK2MSFTNGP04.phx.gbl...
> 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


Ashutosh

10/21/2008 5:20:00 PM

0

Thanks!

sloan wrote:
> Take a look here:
>
> http://sholliday.spaces.live.co...!A68482B9628A842A!114.entry
> XmlSerialization with IDictionary and CollectionBase Objects
>
>
>
> "Ashutosh" <smbs-msdn@nospam.nospam> wrote in message
> news:%23T8ibzsMJHA.4380@TK2MSFTNGP04.phx.gbl...
>
>> 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
>>
>
>
>