System.Type.GUID inter computer consistency (???)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I am using the System.Type.GUID to identify similar types on different
computers, one computer send the GUID through a socket while the other
resolve the GUID and identify the type, when working on a single computer
everything works fine, BUT, when working on two different computers the GUID
extracted from one type is different from the GUID extracted from the same
type on the other computer. why is that happening? shouldn't a guid
representing one type on one computer be similar to the guid of the same type
on the other computer?????
Is there any other consistent identifier ( of a constant size ) that can be
extracted from a type? in the unmanaged reflection API I could use the
TokenId of the type BUT, I didn't find a way to get this ID through managed
code...
 
shouldn't a guid
representing one type on one computer be similar to the guid of the same
type
on the other computer?????

Definitely not. A GUID is GLOBALLY unique, that's what the G stands for
 
Nadav said:
I am using the System.Type.GUID to identify similar types on different
computers, one computer send the GUID through a socket while the other
resolve the GUID and identify the type, when working on a single computer
everything works fine, BUT, when working on two different computers the GUID
extracted from one type is different from the GUID extracted from the same
type on the other computer. why is that happening? shouldn't a guid
representing one type on one computer be similar to the guid of the same type
on the other computer?????

Are you defining your *own* Guids with the
System.Runtime.InteropServices.GuidAttribute?
If not, you're looking for trouble, because
the Guids are automatically generated at compile
time.
Is there any other consistent identifier ( of a constant size ) that can be
extracted from a type? in the unmanaged reflection API I could use the
TokenId of the type BUT, I didn't find a way to get this ID through managed
code...

The most consistent indentifier is the type itself,
so try to send a serialized type over the wire.
This implies, that all computers have the save
type version, so you have to build an assemby
from that "remoted" types and keep it in sync
on all computers.

If you don't care about the type versioning,
then you may send the type name, but you're still
looking for trouble, because you may exchange
soma data between computers having different
versions of that type.

Finally, why on earth aren't you using remoting??

bye
Rob
 
Back
Top