Hello,
Console.ReadKey should definitely work.
What if you try :
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Press any key to end...");
Console.ReadKey();
}
}
For now my understanding is that you have a console application and that at
the end of the program you want to keep the window open until the user
presses a key.
As Alberto I found for now your question quite confusing (seems unrelated
with stepping throught code with F11 or the JIT compiler). Note thought that
Console.ReadKey gives focus to the console window so pressing F11 again will
be taken as an input so you'll run the whole code includign terminating the
program if you just keep pressing F11. Could it be what you experience ?..
--
Patrice
AA2e72E said:
Thanks Alberto; that works but does not give me quite what I want.
I was hoping for some configuration option to 'force' the window to stay
open e.g. when you Ctrl + F5, there is a prompt to close the window.
I am JIT compiling code i.e. working outside VS & would like to find some
way of maintaining the Window when the JIT code runs.
I tried Console.ReadKey() as a means of halting the code & expecting me to
[ress a key but that does not seem to work.
Alberto Poblacion said:
If I am stepping through the code using F11, how can I leave the
Console
'window' remain open/visible after a Console.WriteLine statement?
Do not maximize the Visual Studio window. Rearrange the windows on
your
desktop so that Visual Studio and the Console window are shown
side-by-side.
In this way you can press F11 on Visual Studio at the same time that you
can
see what is being displayed in the Console that is shown on one side.
.
.