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 Refactoring

Unexpected Symbol

Hi i'm getting an error that says: Program.cs(63,24): error CS1519: Unexpected symbol `( ' in class, struct, or interface member declaration

I cant seem to find out what's wrong in my code https://w.trhou.se/48j9o1tmnm

1 Answer

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

Hi there! It's because that particular line doesn't fall inside of the main function, but outside of it. So now, it no longer has access to System.Console. I moved the line up to where the user can type in quit. Take a look:

if (entry.ToLower() == "quit")
                {
                    Console.WriteLine("Goodbye");
                    break;
                }

Hope this helps! :sparkles:

thank you!