T
Tamir Khason
Code
public class RootSerialized
{
[XmlElement("SomeCollection")]
public SomeCollection SomeThings;
}
public class SomeCollection: BaseCollection ,ITypedList ,IBindingList
{
public SomeCollection() : base()
{
}
[XmlElement("Something")]
public Something this[int index]
{
get
{
return (Something )m_al[index];
}
}
}
During the serialization
XmlSerializer s = new XmlSerializer( typeof( RootSerialized ) );
this this structure return error:
System.InvalidOperationException: There was an error generating the XML
document. ---> System.InvalidCastException: Specified cast is not valid.
So what is the problem?
public class RootSerialized
{
[XmlElement("SomeCollection")]
public SomeCollection SomeThings;
}
public class SomeCollection: BaseCollection ,ITypedList ,IBindingList
{
public SomeCollection() : base()
{
}
[XmlElement("Something")]
public Something this[int index]
{
get
{
return (Something )m_al[index];
}
}
}
During the serialization
XmlSerializer s = new XmlSerializer( typeof( RootSerialized ) );
this this structure return error:
System.InvalidOperationException: There was an error generating the XML
document. ---> System.InvalidCastException: Specified cast is not valid.
So what is the problem?