I am aware of how unhanded exceptions are processed when using Task
s, only throwing an unhandled in the finalizer if user code hasn't 'observed' it yet.
I am also aware of how an unhandled exception in an async thread (e.g. Action.BeginInvoke()
) is caught and re-thrown on the joining call (e.g. Action.EndInvoke()
).
What I don't understand though is how this doesn't crash the process?
static void Main(string[] args)
{
var timer = new System.Timers.Timer() {Interval = 100};
timer.Elapsed += (o, e) => { throw new Exception(); };
timer.Start();
Console.ReadKey( true );
}