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 Formatting Output

Glen Tyree
Glen Tyree
6,997 Points

Copy and pasted provided code and I get an error CS1514. Im not sure how to move forward in the lesson now?

Copy and pasted provided code and I get an error CS1514. Im not sure how to move forward in the lesson now?

Steven Parker
Steven Parker
217,443 Points

To facilitate analysis of your issue, make a snapshot of your workspace and post the link to it here.

Glen Tyree
Glen Tyree
6,997 Points

My bad here is the right snapshot. https://w.trhou.se/xvcj6wj3ob

1 Answer

Steven Parker
Steven Parker
217,443 Points

You said you "Copy and pasted provided code", but the code in your workspace is very different from what is supplied in the teacher's notes along with that video. In particular:

  • you have "Treehoude" instead of "Treehouse"
  • you're missing the open brace after the namespace (and the close at the end)
  • you call "Console.ReadLline" twice instead of once
  • you have just "WriteLine" instead of "Console.WriteLine"

And it won't prevent the code from compiling, but the sample code has a loop and yours does not.

But if you fix these it should get you going again.

Steven Parker
Steven Parker
217,443 Points

The code in your new snapshot is also different from the code provided in the notes, but this time only by the addition of a new variable that is initialized but never used

This causes a warning (not serious) during compilation, but otherwise the program compiles and runs with no errors.