How to Fix Wpf Error: "Program Does Not Contain a Static 'Main' Method Suitable for an Entry Point"

How to fix WPF error: Program does not contain a static 'Main' method suitable for an entry point?

Check the properties of App.xaml. Is the Build Action still ApplicationDefinition?

Error Message CS5001 Program does not contain a static 'Main' method suitable for an entry point, have multiple classes

May be your program doest not contain Main which is the entry point of console application so replace with and read this

 class Hello 
{

public void SituationSecondOne()
{
Console.WriteLine(" ");
Console.WriteLine("Choices:");
Console.WriteLine("1: First");
Console.WriteLine("2: Second");
Console.WriteLine(" ");

int ChoiceOne = Convert.ToInt32(Console.ReadLine());

switch (ChoiceOne)
{
case (1):
Console.WriteLine("TEST2");
break;
case (2):
Console.WriteLine("TEST2");
break;
case (1337):
Console.WriteLine(" ");
Console.WriteLine("Thank you for playing");
Console.ReadLine();
Environment.Exit(1);
break;
default:
Console.WriteLine(" ");
Console.WriteLine("Now, let's try that again ... (¬_¬)");
SituationSecondOne();
break;
}
}
static void Main()
{
SecondSet s2 = new SecondSet();
Console.ReadKey();
}
}

Program does not contain a static ‘Main’ method suitable for an entry point

Create a .NET Class Library project if you only want a library project. If this is a project that already exists, you can set the Project Output type to a DLL ("Class Library") instead of an Executable ("Windows Application"/"Console Application") in the project properties.



Related Topics



Leave a reply



Submit