Trying to serialize CultureInfo object
Hi, I'am trying to serialize CultureInfo object (here becomes the code)
private void SerializeCulture(string filename) {
CultureInfo ci = new CultureInfo("es-AR", false);
XmlSerializer ser = new XmlSerializer(ci.GetType());
TextWriter writer = new StreamWriter(filename);
ser.Serialize(writer, ci);
writer.Close();
}
And when I run the project I have this error:
"An unhandled exception of type 'System.InvalidOperationException' occurred in system.xml.dll
Additional information: There was an error reflecting 'System.Globalization.CultureInfo'."
in the line "XmlSerializer ser = new XmlSerializer(ci.GetType());"
------------------------------------------------------------------
SOMEONE CAN HELP ME ON THIS?
Thanks a lot.
|