467,864 Members | 1,913 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,864 developers. It's quick & easy.

Hashtable different in Compact Framework than in the normal Framework?

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é
Nov 15 '05 #1
  • viewed: 1830
Share:
4 Replies
André Giesing <an**********@gmx.de> wrote:
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.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #2
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é
Nov 15 '05 #3
André Giesing <an**********@gmx.de> wrote:
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?


It's a subset though - a different version. Some objects will have
fewer fields; some may even have more.
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?


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.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #4
Most defenitely the binary serialization of different versions will be
different. You should try custom serialization

André Giesing wrote:
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é


--
Regards,
Dilip Krishnan
MCAD, MCSD.net
dilipdotnet at apdiya dot com
Nov 15 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Joseph Lee | last post: by
33 posts views Thread by Ken | last post: by
1 post views Thread by Tomá¹ Machala | last post: by
1 post views Thread by Davie | last post: by
9 posts views Thread by raylopez99 | last post: by
reply views Thread by jack112 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.