0

Console and Writeline code missing

Code playground at my phone and pc have no Console or Writeline (maybe im wrong too) please explain why ..\Playground\(14,12): error CS0117: 'Console' does not contain a definition for 'writeline' ..\Playground\(15,15): error CS0117: 'Console' does not contain a definition for 'writeline' ..\Playground\(17,18): error CS0103: The name 'convert' does not exist in the current context ..\Playground\(17,34): error CS0103: The name 'console' does not exist in the current context ..\Playground\(18,7): error CS0103: The name 'console' does not exist in the current context

24th Jul 2017, 5:56 AM
Antony Reyes
Antony Reyes - avatar
9 Antworten
+ 1
I see whats wrong. C# is case sensitive, so "console.writeline" is not the same as "Console.WriteLine". You have to write it exactly like I mentioned in my first solution (with capital letters), otherwise the Compiler don't know what you are doing. Simply copy and paste the following and try it again: Console.Writeline("test");
24th Jul 2017, 6:40 AM
A. Berger
A. Berger - avatar
+ 1
Don't worry, this can happen. :P As a little help to quickly see if it's written in a correct way, try to write the wrong code line below the correct one. Console.WriteLine(); console.writeline(); You can see the difference with the colored text. Blue: Function-, Method- and Classnames (as well as data types) Purple: keywords White: variable- and property namens Red: variable values So if you are calling a method (like Console.WriteLine) and it is NOT blue, you can assume it's wrong.
24th Jul 2017, 6:55 AM
A. Berger
A. Berger - avatar
0
I tried and it's there. Try it like that: "Console.WriteLine("test");" (Of course without the "")
24th Jul 2017, 6:06 AM
A. Berger
A. Berger - avatar
0
doesnt work
24th Jul 2017, 6:17 AM
Antony Reyes
Antony Reyes - avatar
0
Can you post your whole code?(or a short test code) Maybe something is missing.
24th Jul 2017, 6:25 AM
A. Berger
A. Berger - avatar
0
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SoloLearn { class Program { static void Main(string[] args) { console.writeline("test"); } } }
24th Jul 2017, 6:35 AM
Antony Reyes
Antony Reyes - avatar
0
k wait
24th Jul 2017, 6:41 AM
Antony Reyes
Antony Reyes - avatar
0
thanks man ... omg i feel so dumb because i though that it would be no difference 😂
24th Jul 2017, 6:44 AM
Antony Reyes
Antony Reyes - avatar
0
Okay, thanks for your time. :)
24th Jul 2017, 6:56 AM
Antony Reyes
Antony Reyes - avatar