Serializing a class with embedded xml

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • chaitanyag@hotmail.com

    Serializing a class with embedded xml

    Hi,

    Might be a bit of a silly question, but here goes...

    I am trying to serialize a class that contains an
    System.Xml.XmlA ttributeCollect ion data type. It keeps giving me an
    error saying "you must implement the Add(System.Xml. XmlAttribute)
    method on System.Xml.XmlC ollection because it inherits from
    icollection.".

    The docs

    say the same thing.

    But xmlattributecol lection doesn't have an Add method. Does this mean I
    have to inherit another class from the xmlattributecol lection and use
    that as a container? Has anyone tried to serialize a class that
    essentially looks something like

    Public class A
    {
    public string A1;
    public System.Xml.XmlA ttributeCollect ion A2;
    }

Working...