Results 1 to 2 of 2

Thread: XmlSerializer to serialze a class with a collection

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2009
    Posts
    31

    XmlSerializer to serialze a class with a collection

    Hi all,

    I have a custom class that has one property as a collection.
    For some reason XmlSerializer doesnt like the class having a collection property and the Serialize Fails!

    If I remove the collection property it works!
    Is there a special way of getting the collection in the class to work?

    Cheers in advance!

  2. #2
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: XmlSerializer to serialze a class with a collection

    Is your collection of the type Collection? If so, the reason your serialization fails is because the Collection class is not serializable. Consider using a List(Of T) instead.
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width