Error During Binary Deserialize - URGENT

prashanthks

Newcomer
Joined
Mar 31, 2009
Messages
2
Hi All ,

When I attempt to deserialize a stream , I receive the error stating " No map for object 67108864 " .

The Code:

Serialize:

list<String> m_QueryList = new list<string>
string str = "some Text";

Stream stream = File.Open(e.FullPath, FileMode.Open);
m_QueryList.Add(str);
binFormater.Serialize(stream, m_QueryList);
stream.Close();


Deserialize :

Stream stream = File.Open(e.FullPath, FileMode.OpenOrCreate);
m_recvdList = (List<string>)binFormater.Deserialize(stream);
stream.Close();


Could someone kindly help me fix this error .



Thanks and Regards,
Prashanth.
 
Using the following code, the program compiled and executed as expected:
Code:
List<String> m_QueryList = new List<string>();
string str = "some Text";

Stream stream = new MemoryStream();
m_QueryList.Add(str);
BinaryFormatter binFormatter = new BinaryFormatter();
binFormatter.Serialize(stream, m_QueryList);
//stream.Close();



stream.Seek(0, SeekOrigin.Begin );
List<string> m_recvdList = (List<string>)binFormatter.Deserialize(stream);
stream.Close();
 
Back
Top