Serialized Hashtable

F

Finn J Johnsen

Hi

I've tried moving a serialized hashtable made in WinXP (std .Net
framework), to a PocketPC device (Compact Framework). I've ran in to all
kinds of problems, and have not been able to get this to work. The
problem is not in the actual filecopy.

I've tried the CompactFormatter
(http://www.freewebs.com/compactFormatter/) for binary serialization.
No luck when deserializing on the device. CF wont deserializa std
framework, vice versa.

I've tried XML serialization from opennetcf
(http://www.opennetcf.org/library/OpenNETCF.Xml.Serialization.html). Got
a problem since Hashtable implement IDictionary. For some reason.

Is there another way to do this? Is there a reason why this should not
work, or is it me who's doing this all wrong.

If Hashtable in std framework is differently implemented than the
Hashtable in CF, that would explain incompatibility when deserializing.
But is that the case?

Thanks,
Finn
 
A

Alex Feinman

I suggest instead serializing two arrays - Keys and Values using CopyTo
method. On the other end add the values to the new collection in a loop.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top