0

VB2012 I have a class which I am serializing to a file as such

Dim fileXml As String = "C:\out.xml"
swXml = New StreamWriter(fileXml)
Dim serXml As New XmlSerializer(nzp.GetType)
serXml.Serialize(swXml, nzp)

This all works great except there is one field that is a System.Drawing.Color and that doesn't get saved. Does serialization only work for basic types? How do I get the framework to save more complex types?

vcsjones
  • 138,677
  • 31
  • 291
  • 286
sinDizzy
  • 1,300
  • 7
  • 28
  • 60
  • 1
    This may help http://stackoverflow.com/questions/376234/best-solution-for-xmlserializer-and-system-drawing-color – Mr. T Jul 30 '15 at 21:05
  • Thanks. That gave me the idea of saving it as a string in HTML spec. Then I just convert to HTML and then from HTML. It works. – sinDizzy Jul 30 '15 at 21:18
  • XmlSerializer does not operate on fields. I assume you meant property. – Sam Axe Jul 31 '15 at 01:42

0 Answers0