Possible Duplicate:
Are automatically generated GUIDs for types in .NET consistent?
I want to use Type
as a key dictionary, but I'd rather use either full type name or Type.GUID
. How reliable and correct is Type.GUID
for this task?
Ayende Rahien writes:
Can you rely on System.Type.GUID to be stable?
By stable I mean that it will generate the same value for the same type across compilations. Empirical evidence suggest that this is the case, with the following factors determining the Guid of a type:
- Type name (including the namespace)
- Assembly name
- Assembly public key
Reflectoring into the system, it turns out that System.Type.GUID is eventually translated to a call to System.RuntimeType.GetGUID, this is one of the scary InternallCall method that are implemented directly in the runtime itself.
I wonder...