This is a probably an embarasing question as no doubt the answer is blindingly obvious.
I\'ve used Visual Studio for years, but this is the first time I\'ve done any
Just press CNTRL + F5 to open it in an external command line window (Visual Studio does not have control over it).
If this doesn't work then add the following to the end of your code:
Console.WriteLine("Press any key to exit...");
Console.ReadKey();
This wait for you to press a key to close the terminal window once the code has reached the end.
If you want to do this in multiple places, put the above code in a method (e.g. private void Pause()
) and call Pause()
whenever a program reaches a possible end.