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 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
231,269 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
231,269 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
231,269 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.