Given the following 3 file classes:
file class MyClass
{
}
file class MyClass2
{
}
file class MyClass3
{
public int MyMember { get; init; }
}
By compiling this code and then decompiling this C# code, the file classes now look like:
internal class <Class1>FFEAE62924BA736A3C9E8DE39EA3099D227B65B02C0A6BC7FECCB5FF0D5B9D8B3__MyClass
{
}
internal class <Class1>FFEAE62924BA736A3C9E8DE39EA3099D227B65B02C0A6BC7FECCB5FF0D5B9D8B3__MyClass2
{
}
internal class <Class1>FFEAE62924BA736A3C9E8DE39EA3099D227B65B02C0A6BC7FECCB5FF0D5B9D8B3__MyClass3
{
public int MyMember { get; init; }
}
I understand that <Class1>
is the name of the source file where the file class was defined, and MyClass...
is the name of the file class.
What I don’t understand is this very long, seemingly ID between the two:
FFEAE62924BA736A3C9E8DE39EA3099D227B65B02C0A6BC7FECCB5FF0D5B9D8B3
From what I understand, it seems to vary based on the source file name, which is surprising when the text between two angle brackets, <Class1>
, already seems to play a role.
How does the C# compiler produce this ID? What are the factors that affect it? I could not find any information about it on the internet. I would like to know for a reason, not just because I’m curious.