Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialAhmad Al-arn'uti
Courses Plus Student 684 PointsConsole
Hi I'm AHMAD and I Follow you in the Tutorials and when i write A (mcs Program.cs) in Console this what Happen error CS5001: Program Program.exe' does not contain a static
Main' method suitable for an entry point
Compilation failed: 1 error(s), 0 warnings
5 Answers
Arkadiusz Kurnicki
10,877 PointsI have the same problem. Methods above do not work. CODE: class Program { public static void Main() { // Prompt user for minutes exercised System.Console.Write("Enter how many minutes you exercised: ");
// Add minutes exercised to total
// Display total minutes exercised to the screen
// Repeat until user quits
}
}
ERROR:
treehouse:~/workspace$ mcs Program.cs
error CS5001: Program Program.exe' does not contain a static
Main' method suitable for an entry point
Compilation failed: 1 error(s), 0 warnings
Patrik Horváth
11,110 PointsYour problem is simple Main() method have to be always PUBLIC, STATIC and VOID :)
Ahmad Al-arn'uti
Courses Plus Student 684 Pointswhen I run a console in mac I mast Write a (mono Program.exe) But In windows I don't know what I Do ?
Patrik Horváth
11,110 Pointsidk i use Play Button and when biulding i just Biuld Artifacts its all automated :)
Ahmad Al-arn'uti
Courses Plus Student 684 PointsI don't Know man this not work
Stuart Lockhart
8,861 PointsYour main method should look like this:
public static void Main()
{
}
Ahmad Al-arn'uti
Courses Plus Student 684 PointsI am studying C# Maybe don't have a Public thanks guys :)
Ahmad Al-arn'uti
Courses Plus Student 684 PointsIt's all right in mac