Hashtable different in Compact Framework than in the normal Framework?

A

André Giesing

Hello NG!

I've got a short question:
Is there a difference of the internal representation of a Hashtable between
the Compact Framework and the normal Framework?

I've got the suspicion, because when I Serialize the same Object (with a
Hashtable in it) on a Computer with the normal .NET Framework and on a
mobile Device (which uses the Compact Framework) the byteStream is
different!
The byteStream of the mobile Device is always a little smaller!
And therefore the Desirialization of the Object on the other side fails :-(

For Serialization and Deserialization I use the CompactFormatter which works
pretty good. Locally (when I Serialize and Deserialize on the same Device
with the same Framework) it works!
Objects without a Hashtable also work (even the Deserialization on the other
side)!

So I guess that the representation of a Hashtable between the two Frameworks
might be different.

Could that be?
Or am I on the wrong way?
Any Ideas?

Greetings,
André
 
J

Jon Skeet [C# MVP]

André Giesing said:
I've got a short question:
Is there a difference of the internal representation of a Hashtable between
the Compact Framework and the normal Framework?

I've got the suspicion, because when I Serialize the same Object (with a
Hashtable in it) on a Computer with the normal .NET Framework and on a
mobile Device (which uses the Compact Framework) the byteStream is
different!
The byteStream of the mobile Device is always a little smaller!
And therefore the Desirialization of the Object on the other side fails :-(

If you're trying to serialize something using one version of the
framework and deserialize it using another, I think you're almost
*bound* to run into problems. It's just not going to work.
Objects without a Hashtable also work (even the Deserialization on the other
side)!

Some objects will - others won't. Relying on it sounds like a really
bad idea to me.
 
A

André Giesing

Hi Jon!
If you're trying to serialize something using one version of the
framework and deserialize it using another, I think you're almost
*bound* to run into problems. It's just not going to work.

Why other versions of the framework?
I'm using the .NET Framework on the one side and the .NET
Compact Framework on the other side. And the CF should be
a subset of the full .NET Framework, shouldn't it?
Some objects will - others won't. Relying on it sounds like a really
bad idea to me.

Which object will do and which won't?
Or do I have to try and wait for failures?

So in your opinion serializing and deserialising between the .NET
Framework and the Compact Framework will not do?

Greetings,
André
 
J

Jon Skeet [C# MVP]

André Giesing said:
Why other versions of the framework?
I'm using the .NET Framework on the one side and the .NET
Compact Framework on the other side. And the CF should be
a subset of the full .NET Framework, shouldn't it?

It's a subset though - a different version. Some objects will have
fewer fields; some may even have more.
Which object will do and which won't?
Or do I have to try and wait for failures?

No, just don't do it in the first place.
So in your opinion serializing and deserialising between the .NET
Framework and the Compact Framework will not do?

Indeed - it's just a bad idea.
 
D

dilipdotnet at apdiya.com

Most defenitely the binary serialization of different versions will be
different. You should try custom serialization
 

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