AA2e72E wrote:
> Hi Patrice,
> As I said in my previoud post:
>
> - Alberto's suggestion does work
> - I have already tried Console.ReakKey() and it does not keep the window open
>
> It is possible that F11 triggers F11 as the completion of Console.ReakKey().
>
> I have a code snippet: it is the same as in a Console Application and I am
> compiling it using JIT. My original intention was to find some way of
> ensuring the same behaviour as Ctrl+F5 in a console application both from a
> console application and Jit compiled code. So far, I can use Alberto's
> suggestion with console application and I am still searching for a way to
> prevent the window from closing with the Jit code.....
>
> "Patrice" wrote:
I don't know what you are doing, but I'm pretty sure that it's not what
you are saying that you are doing...
It seems that you are confused about the JIT compiler. The JIT compiler
is not an alternative to how code is executed normally, it *is* the way
that code is executed normally. It's the JIT compiler that creates the
executable code from the IL code that the C# compiler produces. JIT
stands for Just In Time, because the compiler does it's work just before
the code is executed.
If you mean that you compile the code into a native executable, that is
not done by the JIT compiler, that is done by a tool like Ngen.
If you mean that you are compiling the code manually outside Visual
Studio, the compilation process is still the same.
-
If you want to do something like the Visual Studio environment does, but
not as sensetive as to trigger on your F11 keypresses, perhaps you
should wait for a specific key:
Console.WriteLine("Press Esc to quit.");
while (Console.ReadKey(true).Key != ConsoleKey.Escape) { }
--
Göran Andersson
_____
http://www.guffa.com