I have a custom class that only has one property of type string.
Attempting to serialise an object of this class as an attribute using XmlSerializer results in the exception:
XmlAttribute/XmlText cannot be used to encode complex types
Now I know I can fudge this my creating a pseudo string property in my containing type and serialising that instead, but is there any way at all to make my custom class support it intrinsically?
How do .Net classes do it (eg DateTime)?