9

maybe some of you know, that Visual Studio (Preview) is ready to use.

I have simple question, maybe I did something wrong, or it doesn't work properly.

When I start to debug Console Application doesn't want to let me read name from keyboard.

string name = Console.ReadLine();
Console.WriteLine(name);

Can someone help me? I'd like to see how it works correctly.

Lex Li
  • 60,503
  • 9
  • 116
  • 147
M. Pilarczyk
  • 113
  • 1
  • 1
  • 5
  • You don't say what problem you're having. What does "doesn't want to let me read name from keyboard" mean? – J. McCabe Nov 19 '16 at 10:56

1 Answers1

27

By default VS for Mac uses Application Output panel to simulate the console.

In your case, an external console should be used, which you should open Project Options and check the box before Run on external console under Run|Configurations|Default.

Lex Li
  • 60,503
  • 9
  • 116
  • 147
  • Thank you very much. Now it works. – M. Pilarczyk Nov 19 '16 at 18:43
  • https://meta.stackoverflow.com/questions/359302/merge-tags-visual-studio-mac-and-visual-studio-for-mac?noredirect=1#comment531840_359302 – Hans Passant Nov 13 '17 at 22:00
  • Wow, so glad I found this answer. Thanks Lex Li. Except in my case it was *unticking* that box, which allowed VS console to start showing me the expected output. The box had been ticket by default and seemed to be stopping the console from exhibiting any of the expected behaviour. – olisteadman Jan 27 '19 at 20:39
  • In my console application when I execute the console.write ("Enter value") the text appears in the output panel but I can not put any value because the next instruction is executed: int firstAltitude=int.Parse(Console.readLine()) and crash with null value – kintela Jun 26 '19 at 07:15