Hello,
I'm a newbie to Visual C# and I am trying to create the dirt simple "Hello World" sample as a Console Application and when I run my program the console window blinks up then disappears...it closes itself. Anyone know what's going on here
To debug, I set a breakpoint at my "static void Main()" line and the code starts, a blank console window even appears but as soon as the program executes the "Console.WriteLine("Hello World");" line, the console window disappears. ( ! )
I need some help here. And now, the code...
using System;
using
System.Collections.Generic;using
System.Text;namespace
HelloWorld{
class Hello{
static void Main(){
Console.WriteLine("Hello World");}
}
}
Thanks 1,000,000 for your help! ![]()

Console window keeps closing itself
Debblr
Hi,
It seems that all of your output is redirected to the quick console. To disable this:
1. Choose Tools -> Options
2. Expand Debugging -> General
3. Uncheck Redirect all console output to the Quick console window.
cheers,
Paul June A. Domag
dekzorro
if a console Application at the end of its code it closes itself, even turbo pascal applications do this. To prevent the application closing it self, you use Console.ReadLine() because this makes the app to stop and wait for user input. If you press a key the programs goes on in the code and reaches the end, so it closes after pressing enter.
Tim Shea
I found the answer to my question. It's on page 19 of the book I'm reading. It says when running the program to use Ctrl-F5 to start without debugging. Just like what taumuon said.
OmLeD
Hi,
Place a Console.Readline() in the end of your code. So that the console could stay until you press the enterkey...
cheers,
Paul June A. Domag
AmandaS_MS
dubstar
Thanks again.
Shishir21370
I'm curious... I have to write Console.ReadLine(); every time I want the window to stay I'm doing the Hello World code sample from the O'Reilly "Programming C#" book and it doesn't say anything about this. Is this having to type Console.ReadLine(); every time a normal thing I commented out Console.ReadLine(); to test and the console window closed itself again like it used to.
Simon Ellis
My last question regarding the above quote: Is this a normal thing that everyone does