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 trial

C# C# Basics (Retired) Console I/O Start Coding

Console

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 staticMain' method suitable for an entry point
Compilation failed: 1 error(s), 0 warnings

5 Answers

Arkadiusz Kurnicki
Arkadiusz Kurnicki
10,877 Points

I 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 staticMain' method suitable for an entry point
Compilation failed: 1 error(s), 0 warnings

Patrik Horváth
Patrik Horváth
11,110 Points

Your problem is simple Main() method have to be always PUBLIC, STATIC and VOID :)

when 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
Patrik Horváth
11,110 Points

idk i use Play Button and when biulding i just Biuld Artifacts its all automated :)

I don't Know man this not work

Your main method should look like this:

public static void Main()
{

}

I am studying C# Maybe don't have a Public thanks guys :)

It's all right in mac