L
Luiz Rafael Fernandes
Hi...
i try to serialize a object inherited of label control, as follow:
//definition
public class WinLabel : System.Windows.Forms.Label
{
public WinLabel() {}
}
//execution
WinLabel l = new WinLabel();
l.Text="text";
l.Name="name";
XmlSerializer ser = new XmlSerializer(typeof(MO.WinLabel)); //error
happening this line
FileStream fs = File.OpenWrite("c:\\label.xml");
XmlTextWriter x = new XmlTextWriter(fs,System.Text.Encoding.UTF8);
x.Formatting=Formatting.Indented;
try
{
ser.Serialize(x,l);
}
finally
{
fs.Close();
}
But error happening: "An unhandled exception of type
'System.InvalidOperationException' occurred in system.xml.dll"
thank's for any help..
ps.: sorry my bad english...
i try to serialize a object inherited of label control, as follow:
//definition
public class WinLabel : System.Windows.Forms.Label
{
public WinLabel() {}
}
//execution
WinLabel l = new WinLabel();
l.Text="text";
l.Name="name";
XmlSerializer ser = new XmlSerializer(typeof(MO.WinLabel)); //error
happening this line
FileStream fs = File.OpenWrite("c:\\label.xml");
XmlTextWriter x = new XmlTextWriter(fs,System.Text.Encoding.UTF8);
x.Formatting=Formatting.Indented;
try
{
ser.Serialize(x,l);
}
finally
{
fs.Close();
}
But error happening: "An unhandled exception of type
'System.InvalidOperationException' occurred in system.xml.dll"
thank's for any help..
ps.: sorry my bad english...