0
Why the console window disappears whenever I debug?
I'm using Microsoft Visual Studio 2015. and whenever I try to debug(f5), the program starts...and ends. Suggest that you are trying to debug the simple code below. int num = 0; Console.WriteLine(num); and? something happens, and ends. why this occurs, and how can I get over it? I need your help!(sry to poor Eng)
2 Answers
+ 1
write at the end from the Main method Console.ReadLine();
0
Console window closes because your program finished execution and there is nothing to wait. But you can add Console.ReadLine() after Console.WriteLine() statement and program will wait until you will hit enter key.