Xml and propertygrid Attributes

  • Thread starter Thread starter Romain TAILLANDIER
  • Start date Start date
R

Romain TAILLANDIER

Hi group,

I have a Parameter class, and i need it to be
XmlSerialisable/XmlDeserialisable, and browsable with a property grid using
custom specification about itself but customising property attribute.

example :

[CategoryAttribute("DataBase"),
DefaultValueAttribute(0),
Description("The datatable name.")]
public string TableDB{get{...}set{...}}

Before i had those three attribute, Xml serialisation works perfectly. Since
i had them, it crash with errors at System.Refletion.Assembly.nLoad(...) in
a dynamically generated Dll (I guess).

If i had the XmlIgnore attribute, it works !

So i deduce that other attribute make crush the xml serialisation.
Why ?
Is there tun arround ? or idea to correct that ?

thanks
ROM
 
I found it !!

it was caused by the DefaultValueAttribute.
[CategoryAttribute("DataBase"),
DefaultValueAttribute(""),
Description("The datatable name.")]
public string TableDB{get{...}set{...}}

put 0 in it make the XmlSerializer crush.
Note that the string.empty too, this is a mistery too

thanks group
 
Back
Top