[Mono-dev] Type.GUID patch

Robert Jordan robertj at gmx.net
Sat Sep 3 16:59:47 EDT 2005


Hi Kornél,

> Type.GUID is useful only when using COM interop. Of course there may be
> other uses but I don't tink it is needed for anything else.

Well, it's just another name representation of the type.

> 
> GUIDs are identifiers in COM so I think we should not implement a different
> algorythm just to return some value. I think it's better to throw an
> exception for type that have no GuidAttribute instead of returning some
> forged value that is different from MS.NET type GUID.

Nothing gets forged here ;-)

GUIDs generated with Uuidgen.exe or similar tools are really
unique, whereas atomatically generated Type.GUIDs are not unique
in all cases: types with the same qualified name will have the
same GUID on all machines on that planet, and that's bad news
for COM.

That's one of the reasons why assemblies that are supposed to
be registered for COM interop must have a strong name.
The strong name assures a unique qualified name and so
a unique GUID.

Rob




More information about the Mono-devel-list mailing list