D
Duggi
Hi
In the following code why it is required to type cast while de-
serialize... any ideas???
to create an object of XmlSerializer, Type is a compalsary parameter.
Atleast by default XmlSerializer should convert it to the Type it is
made for...
class MyClass
{
//Some implementation
}
class Program
{
static void Main(string[] args)
{
MyClass cs;
XmlSerializer s = new XmlSerializer(typeof(MyClass));
FileStream fs = new FileStream("serializedobject.xml",
FileMode.Open);
cs = (MyClass) s.Deserialize(fs);
Console.ReadLine();
}
-Cnu
In the following code why it is required to type cast while de-
serialize... any ideas???
to create an object of XmlSerializer, Type is a compalsary parameter.
Atleast by default XmlSerializer should convert it to the Type it is
made for...
class MyClass
{
//Some implementation
}
class Program
{
static void Main(string[] args)
{
MyClass cs;
XmlSerializer s = new XmlSerializer(typeof(MyClass));
FileStream fs = new FileStream("serializedobject.xml",
FileMode.Open);
cs = (MyClass) s.Deserialize(fs);
Console.ReadLine();
}
-Cnu