Can we have more than one main method in C#?
Yes we can have. But .Net application can have only one entry point. It means that only one main method is allowed. Those Main method is considered to be the entry if it has the signature from any one of following Main methods:
• static void Main(string[] args)
• static void Main()
so below code is allowed:
Below code is not valid and doesn’t compile because it has two entry points:
Below code will also not be compiled because it doesn’t contain a static 'Main' method suitable for an entry point: