G
Guest
Hello... although I've found several posts in reguards to this topic, I don't
seem to understand the solution...
When I derive a class from my base class and then serialize using
XMLSerializer, I do not see the properties of the base class.
Project 1 - Class Library
Public Class nameBase
{
Public string name;
}
Project 2 - WinApp
Public Class names : nameBase
{
Public string location;
}
List<names> toSerialize = new List<names>();
List.add(...)
XmlSerializer mySerializer = new XmlSerializer(typeof(List<names>));
StreamWriter myWriter = new StreamWriter("myFileName.xml");
mySerializer.Serialize(myWriter, toSerialize);
myWriter.Close();
Please help me understand why I don't see the base class name property?
I've tried several XmlInclude(typeof(...)) attributes.
seem to understand the solution...
When I derive a class from my base class and then serialize using
XMLSerializer, I do not see the properties of the base class.
Project 1 - Class Library
Public Class nameBase
{
Public string name;
}
Project 2 - WinApp
Public Class names : nameBase
{
Public string location;
}
List<names> toSerialize = new List<names>();
List.add(...)
XmlSerializer mySerializer = new XmlSerializer(typeof(List<names>));
StreamWriter myWriter = new StreamWriter("myFileName.xml");
mySerializer.Serialize(myWriter, toSerialize);
myWriter.Close();
Please help me understand why I don't see the base class name property?
I've tried several XmlInclude(typeof(...)) attributes.