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
How to Get the Location of the Dll Currently Executing
What's the Difference Between Using the Serializable Attribute & Implementing Iserializable
Photo Capture on Windows Store App for Windows Phone
Yield Return Statement Inside a Using() { } Block Disposes Before Executing
How to Clear Cookies Using ASP.NET MVC 3 and C#
Convert Transparent Png to Jpg with Non-Black Background Color
Build Visual Studio Project Through the Command Line
Translate Perl Regular Expressions to .Net
Can Structs Contain Fields of Reference Types
Check If All Items Are the Same in a List
ASP.NET MVC: Calling a Method from a View
Post-Increment Within a Self-Assignment
How to Embed My Own Fonts in a Winforms App