"The handle is invalid" error when using Console methods in C# Interactive

Viewed 1274

When I use Console functions such as SetCursorPosition or Clear, I get an error saying the handle is invalid.

Example:

> Write("aaa");SetCursorPosition(0, 0);Write("b")
aaaThe handle is invalid.

  + System.IO.__Error.WinIOError(int, string)
  + System.Console.GetBufferInfo(bool, out bool)
  + System.Console.GetBufferInfo()
  + System.Console.SetCursorPosition(int, int)
  + <Initialize>.MoveNext()

> Write("bbb");Clear();
bbbThe handle is invalid.

  + System.IO.__Error.WinIOError(int, string)
  + System.Console.GetBufferInfo(bool, out bool)
  + System.Console.Clear()

How do I fix this and be able to use these functions in the C# Interactive window?

0 Answers
Related