I have a console application and I want it to wait till some event is raised. But it executes the code and exits:
static void Main(string[] args)
{
var someObjectInstance = new SomeObject();
someObjectInstance.SomeEvent += SomeEventHandler;
}
static void SomeEventHandler()
{
//some logic
}
I want to make my application behave like Windows Application where
Application.Run(new Form1());
is called and message loop is runned.
But I don't need neither message loop nor any form. So it looks like overhead. Is there any more light-weight way to achieve my goal?