It is very easy to reproduce:
- Set a long
message or errorMessage
- Reduce the console width so that the message text moves to the next line
- In this case, the cursor will be outside the console window
- Press the cursor key, for example,
Up key
- The
ArgumentOutOfRangeException will occur