New console project template creates a Main method like this:
class Program
{
static void Main(string[] args)
{
}
}
Why is it that neither the Main method nor the Program class need to be public?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The entry point of a program is marked with the
.entrypointIL directive. It does not matter if the method or the class is public or not, all that matters is this directive.