Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

  • Leaders
Posted

Using the following code, the program compiled and executed as expected:

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();

[sIGPIC]e[/sIGPIC]

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...