You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If "The ReadKey method reads from the keyboard even if the standard input is redirected to a file with the SetIn method," what causes it to raise an InvalidOperationException. #10717
Under the Exceptions heading, the cited article states that an InvalidOperationException Exception arises when the standard input stream is directed away from the console. However, the Remarks section states, "The ReadKey method reads from the keyboard even if the standard input is redirected to a file with the SetIn method."
If that is so, the only situation that can give rise to the nvalidOperationException Exception can arise is when the standard input is redirected by a < character in the script, or in the directions given to the CreateProceess Win32 API call that started it.
If my surmise is correct, I suggest that the note under the Exception heading could stand some clarification.