Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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

Greg Patten
Greg Patten
243 Points

Same Code, Saved, No luck...

I have the same code, and yes...I saved.

class Program
{
    static void Main()
    {
      // Prompt the 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
      // Repead until the user quits

    }
}

treehouse:~/workspace$ mcs
error CS2008: No files to compile were specified
Compilation failed: 1 error(s), 0 warnings

What is wrong here? I also couldn't get past the challenge on the next module. Please help.

Moderator edited: Markdown added so that code will render properly in the forums.

2 Answers

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! The problem isn't in the code, it's in the command provided in the terminal. The terminal error indicates this by saying that no files were provided. You called the compiler, but didn't tell it which file it's supposed to compile. The correct command is:

mcs Program.cs

On a side note: I added some markdown to your question so that it will render properly in the forums. Take a moment and check out the Markdown Cheatsheet link at the bottom of the "Add an Answer" section for instructions on how to do this for your posts on the forum.

Hope this helps! :sparkles:

Greg Patten
Greg Patten
243 Points

Thank you that worked!