I am aware of how unhanded exceptions are processed when using Tasks, 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 );
}
From the .NET 4.0 documentation:
http://msdn.microsoft.com/en-us/library/system.timers.timer.aspx
There is no statement yet claiming that this behavior has actually changed.