Visual Studio 2013 Tips & Tricks – Waiting for a Keystroke before the Console Windows Closes without using Console.ReadLine

This trick is applicable not just for Visual Studio 2013 but also for the previous versions of the Visual Studio. By default, when you run a Console Application in Visual Studio by pressing the F5 key, the output or the console window closes quickly before you actually get a chance to read it.

One of the simplest way to solve this issue is to use the Console.ReadLine (); placed at the end of the Main method.

One of the other technique which works without using the Console.ReadLine is using the Start without Debugging option.

Visual Studio 2013 Tips & Tricks - Waiting for a Keystroke before the Console Windows Closes without using Console.ReadLine

When using the Ctrl + F5 (Start without Debugging), the console window appears but it would wait for the key press for it to close.

Visual Studio 2013 Tips & Tricks - Waiting for a Keystroke before the Console Windows Closes without using Console.ReadLine

Leave a Reply