Why does my program work if my Main method in C# is private?

后端 未结 4 2042
太阳男子
太阳男子 2021-01-21 01:30

By default the type modifier for every member in a class is a private, even the Main() function type modifier is private. How does the CLR call the main method which is not visi

4条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-21 02:01

    Try using ildasm on your code and lookout for the main method

    .method private hidebysig static void  Main(string[] args) cil managed
    {
      .entrypoint // this is something the CLR is interested in
    

提交回复
热议问题