0

Exception has occurred:

CLR/System.InvalidOperationException
An unhandled exception of type 'System.InvalidOperationException' occurred in System.Console.dll: 'Cannot read keys when either application does not have a console or when console input has been redirected. Try Console.Read.'
   at System.ConsolePal.ReadKey(Boolean intercept)
   at System.Console.ReadKey()
   at My_Program.Program.Main(String[] args) in C:\Users\hbril\Desktop\My Program\Program.cs:line 1

When debugging I can't get a console window to pop up and vscode won't read 'Console.ReadKey();'

Flydog57
  • 6,851
  • 2
  • 17
  • 18
  • 4
    Please share a [mcve]. And be clear how you are running it. – mjwills Aug 16 '21 at 01:01
  • I'm guessing that your app doesn't include a console, or that your console input has been redirected - just a guess. What kind of app is this (a console app, WinForms, WPF, UWP, a web app, something else)? – Flydog57 Aug 16 '21 at 04:30

0 Answers0