S
surindersaini
Hi
I am not sure if we can do it and if can, then how. I have a class
with a property that return object as its return type.
when i am trying to Serialize the class it gives me error
****************************************************************
An unhandled exception of type 'System.InvalidOperationException'
occurred in system.xml.dll
Additional information: There was an error generating the XML document.
*****************************************************************
below listed a part of class code.
using System;
using System.Xml;
using System.Xml.Serialization;
using System.IO;
using System.Text;
[Serializable()]
public class MyClass
{
private string _firstName;
private object _lastName;
public string FirstName
{
get{return _firstName;}
set{_firstName = value;}
}
public object LastName
{
get{return _lastName;}
set{_lastName = value;}
}
}
I am not sure if we can do it and if can, then how. I have a class
with a property that return object as its return type.
when i am trying to Serialize the class it gives me error
****************************************************************
An unhandled exception of type 'System.InvalidOperationException'
occurred in system.xml.dll
Additional information: There was an error generating the XML document.
*****************************************************************
below listed a part of class code.
using System;
using System.Xml;
using System.Xml.Serialization;
using System.IO;
using System.Text;
[Serializable()]
public class MyClass
{
private string _firstName;
private object _lastName;
public string FirstName
{
get{return _firstName;}
set{_firstName = value;}
}
public object LastName
{
get{return _lastName;}
set{_lastName = value;}
}
}