How does VS compile console applications to show "Press any key to continue"?

.net, c#, console, visual-studio

Solution

You could write a batch script that runs the exe for you and prompts the user to press a key.

The batch script would look something like this:

echo off
YourApp.exe
pause

Problem

When I develop a C# console application (which will run on a server) and I run it using Visual Studio, I get a "Press any key to continue" message before the program terminates. However, when I compile the very same C# code file manually using CSC, my program doesn't show that message and it terminates immediately after finishing its logic. Does anyone know how I can make the same feature when compiling the code without using VS and WITHOUT changing the C# code any adding a ReadLine()? UPDATE : The same message used to appear when I learned C#, I used to use TextPad with CSC, and that message used to appear without adding any Write(Line)/Read(Line) callings

Original source