Santhosh Subramaniam

Santhosh Subramaniam

  • NA
  • 226
  • 102.9k

Not marked as Serializable ....?

Dec 10 2014 1:35 AM
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)