Purpose and meaning of "specialname" and "rtspecialname" in IL

I am trying to understand the IL code and the internal elements of C # at the moment, I wrote a simple C # hello world program whose code is:

using System;
class Program
{
    public static void Main()
    {
       Console.WriteLine("Hello World");
    }
}

and here IL is generated for the constuctor class Program:

.method public hidebysig specialname rtspecialname 
        instance void  .ctor() cil managed
{
  // Code size       7 (0x7)
  .maxstack  8
  IL_0000:  ldarg.0
  IL_0001:  call       instance void [mscorlib]System.Object::.ctor()
  IL_0006:  ret
} // end of method Program::.ctor

I can not understand what the meaning and purpose of specialname and rtspecialname mean or their use?

+4
source share
1 answer

In ECMA 355 standard :

rtspecialname , CLI. ; . , rtspecialname, specialname.

specialname , , CLI. ., , I.

, , , - ( SpecialNameAttribute?) , . , , - , , Main - .


, , . , .

+2

Source: https://habr.com/ru/post/1618157/


All Articles