I have written some sample code in C# to check a few concepts where I have declared two main methods; please find it below for your reference:
class Program
{
public static void Main()
{
Console.WriteLine("Main method called");
Console.ReadKey();
}
public static void Main(char[] args)
{
foreach (char c in args)
{
Console.WriteLine(c.ToString());
}
Console.WriteLine("Char main method called");
Console.ReadKey();
}
}
The code compiles successfully with one warning message:
Program.Main(char[]) has the wrong signature as the entry point
As the CLR has defined Main(string[])
or Main()
as the starting point, is there a possibility that I can make public static void Main(char[] args)
as the starting point?
I have found multiple links on Stack Overflow, but none of them were much useful to me, such as C# Entry Point Function.