Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

C# C# Streams and Data Processing Reading Data Reading a CSV File

Aaron Selonke
Aaron Selonke
10,323 Points

Visual Studios 'Press any key to continue'

When she runs the program, the last piece of code is the Console.WriteLine() to write everything to the console.

Howcome her console does not close immediately. I always end up adding a Console.ReadLine() as the last peice of code in order to stop the program from immediately closing...

How do I set up the program (or the IDE) to return the 'press any key to continue' prompt before exiting the program (and avoid using the Console.ReadLine) - just like Carling in the video

1 Answer

Steven Parker
Steven Parker
231,198 Points

:point_right: I think the pause is automatic.

I'm not aware of having to do anything special to cause that. I got exactly the same results as in the video when I executed in non-debug mode (control-F5), just as she does.

Now, in debug mode (F5) that doesn't happen, but then you can set a breakpoint to keep the app from finishing before you can look at the window.