2
Answers

Not marked as Serializable ....?

Hi Frnds,
 
   I am taking backup of object my using Serialize method , here i am getting error  not marked as Serializable but every thing is marked as Serializable
 I want to take a backup of object any other method is there please tell me.
    
using (MemoryStream ms = new MemoryStream())
{
BinaryFormatter bf = new BinaryFormatter();
bf.Serialize(ms, MyObj);  // -- Error 
ms.Position = 0;
MyObjBackup = (MyClass)bf.Deserialize(ms);
}
 
 Thanks in Advance.
 
 
Answers (2)