I'm using Visual Studio 2010 and Windows 7 x64
The command prompt closes after exit, even though I used "Start without debug". Is there a setting somewhere that I can use?
This question is related to
visual-studio
windows-7
What about Console.Readline();
?
You could open a command prompt, CD to the Debug or Release folder, and type the name of your exe. When I suggest this to people they think it is a lot of work, but here are the bare minimum clicks and keystrokes for this:
I think that's 14 keystrokes and clicks (counting shift-right-click as two for example) which really isn't much. Once you have the command prompt, of course, running it again is just up-arrow, enter.
Yes, in VS2010 they changed this behavior somewhy.
Open your project and navigate to the following menu: Project -> YourProjectName Properties -> Configuration Properties -> Linker -> System. There in the field SubSystem use the drop-down to select Console (/SUBSYSTEM:CONSOLE) and apply the change.
"Start without debugging" should do the right thing now.
Or, if you write in C++ or in C, put
system("pause");
at the end of your program, then you'll get "Press any key to continue..." even when running in debug mode.
Add a Console.ReadKey
call to your program to force it to wait for you to press a key before exiting.
Source: Stackoverflow.com