Need help with error code CS0117!

I need help with an error code which I got when on the c# course.

This is the code I wrote

Hi there.

In future please can you provide your code in a reusable form - for example, by correctly formatting it and posting it in your topic when you ask for help..

Also, the full text of the error message is most helpful - in no small part, because usually the error gives you the line and column number of where the error occurred.

On this occasion, however… CS0117 is an error of 'type' does not contain a definition for 'identifier'. Given that you are attempting to call Console.WriteLines(), which does not exist, I suspect that might be the cause of your error.

(The LE error probably told you as much, because if I make a similar call in a REPL to Console.WriteLines("Boo!"); I get back: main.cs(10,13): error CS0117: 'System.Console' does not contain a definition for 'WriteLines')

1 Like

thank you!
I understand this already, but how would I fix this issue?

Well, seeing as how the issue is error CS0117: 'System.Console' does not contain a definition for 'WriteLines' I’d say you need to fix that line of code. The error message will be telling you where the fault is - in my case, it was Line 10 Col 13 but your code will be different.

Since you’ve made multiple calls to methods provided by System.Console elsewhere in your code, it shouldn’t be too hard for you to re-read what you’ve written and find how the line that the compiler is complaining about differs from others in your program.