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) Perfect if / else if / else

Mark Wilkowske
PLUS
Mark Wilkowske
Courses Plus Student 18,131 Points

C# Workspace not working I'm getting this error persistently. (1,12): error CS1525: Unexp

https://w.trhou.se/089g4b20k8 - look in Program.cs

I'm getting this persistent error. (1,12): error CS1525: Unexpected symbol .', expecting,', ;', or='

For troubleshooting I tried removing whatever is at line 1 - using System; and the namespace for example - and still get the error. In my text editor I tried showing all visible characters and didn't see anything weird. Thanks for you help!

3 Answers

Steven Parker
Steven Parker
230,688 Points

:white_check_mark: I forked your workspace snapshot, and your program compiled — and ran — with no errors.

Are you sure you made this snapshot after you started seeing the errors?

Otherwise, the only think I can think of to do is save your code, delete the workspace, re-create the workspace, then replace your code and recompile.

Mark Wilkowske
PLUS
Mark Wilkowske
Courses Plus Student 18,131 Points

Thank you Steve - I was running the code from the REPL and not the command line.

Arthur Bridgeman
Arthur Bridgeman
2,734 Points

I had this same problem and could not figure out what I did wrong. Trouble shoot: Check that your Program.cs file is 'Saved' and that the edit dot is not showing. Also, Do not use the 'csharp' command to get the REPL activated. Make sure that if you have REPL activated through the csharp command to 'quit' first, then after treehouse:~/wokspace$ type mcs Program.cs && mono Program.exe then hit enter