Question: HHow do I fix this exception? X using System; using System.Collections.Generic; using System.Linq; Exception Unhandled using System.Threading.Tasks; System.Invalid OperationException: 'Cannot read keys when either (using
HHow do I fix this exception?
X using System; using System.Collections.Generic; using System.Linq; Exception Unhandled using System.Threading.Tasks; System.Invalid OperationException: 'Cannot read keys when either (using System.Windows.Forms; application does not have a console or when console input has been redirected from a file. Try Console.Read.' namespace GOLStartUp { O references internal class Program { O references private static void Main(string[] args) { View Details | Copy Details | Start Live Share session... Game game = new Game(); Exception Settings ConsoleKeyInfo keyInfo; while ((keyInfo = Console.ReadKey(true)).Key != ConsoleKey. Escape) { switch (keyInfo.Key) { case ConsoleKey.UpArrow: @
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
