Calculate class code hash at runtime (C #)?

Is it possible to compute a class hash at runtime in C # (presumably through reflection)? To be clear, I do not want to calculate the hash code of an instance of the specified class, I want to calculate the hash of the class code itself (if the function in the class changes, I expect another hash code to be computed). Ideally, this would only be sensitive to changes in the object code (and not just a hash of the string representation of the code itself).

Thanks in advance for your help,

- Brek

+5
source share
2 answers

Type, GetMethod, MethodInfo, , , GetMethodBody, IL . .

. ?

+4

. System.Type.GetHashCode(). , , , type.FullName.GetHashCode()

+1

All Articles