Usually when you debugging the console apps in Visual Studio, you want to keep the console open after the app finishes, so you have the chance to read the console output, but there are cases when your app is the server, and it becomes quite annoying if you want to restart your server, and you click on the stop button in the Visual Studio, and then you need to click on the cross button on the console. There is an option (of course). Go to Debug/Options… select the section Debugging/General, and tick the checkbox Automatically close the console when debugging stops.

Next - Previous