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

Your email address will not be published. Required fields are marked *

You May Also Like

Do you want to hide the start page in Microsoft Visual Studio 2012 within few simple steps? Here we go....
DataTip is a feature in Visual Studio that provides the users an easy way to view information about variables used...
Today, when I was trying to install the Team Foundation Server (TFS) Power Tools 2013, I received an error “The...