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.

Deepak VermaRank #672 · 3.6K reputationPosted Dec 9, 2014, 9:21 PM EST
Write the [Serializable] just before the class, belongs to MyObj.
Santhosh Subramaniam189 reputationPosted Dec 9, 2014, 9:39 PM EST