Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Program.Main(string[])' has the wrong signature to be an entry point Format For Project

Tags:

c#

I have a warning and an error in Microsoft Visual studio 2019. Everything was working just fine and this seemed to pop up out of no where.

Main is defined as:

 static object Main(string[] args)

But I am getting this whilst trying to compile:

Warning CS0028 'Program.Main(string[])' has the wrong signature to be an entry point Format For Project

Error CS5001 Program does not contain a static 'Main' method suitable for an entry point Format For Project

like image 432
xarzu Avatar asked Jan 01 '23 19:01

xarzu


1 Answers

There are a number of possible signatures for the entry point in to a C# program. Unfortunately static object Main(string[] args) is not one of them.

I'd say your most likely candidate is either

static int Main(string[] args)

Or

static void Main(string[] args)

For more info checkout Main Method in C# on GeeksforGeeks

like image 167
phuzi Avatar answered Jan 12 '23 01:01

phuzi