prashanthks Posted March 31, 2009 Posted March 31, 2009 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. Quote
Leaders snarfblam Posted March 31, 2009 Leaders Posted March 31, 2009 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(); Quote [sIGPIC]e[/sIGPIC]
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.