C# console program wait forever for event
You can call Console.ReadLine()
(if you want to terminate on keystroke), or simply Thread.Sleep(Timeout.Infinite)
.
In case of async
main method, one could also use await Task.Delay(-1);
You can call Console.ReadLine()
(if you want to terminate on keystroke), or simply Thread.Sleep(Timeout.Infinite)
.
In case of async
main method, one could also use await Task.Delay(-1);