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

In this post, you’ll learn about the error code “SCC_E_BACKGROUNDGETINPROGRESS” returned by the Visual Studio when using the Source Control...
In this post, you’ll learn about the error code “SCC_E_UNKNOWNERROR” returned by the Visual Studio when using the Source Control...
In this post, you’ll learn about the error code “SCC_E_CONNECTIONFAILURE” returned by the Visual Studio when using the Source Control...