Throwing exceptions in callback method for Timers

后端 未结 4 1605
醉酒成梦
醉酒成梦 2020-12-01 15:47

I was unable to find an answer to this question anywhere...

What happens with the exceptions thrown in the callback method for System.Threading.Timer, (or in the eve

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-01 16:15

    From my humble test under windows 10 framework 4.6, the thread used by the SystemTimers.Timer elapsed event will not propagate the unhandled exception. I needed to fire a event to the main thread to notify the unhandled exception happened.

提交回复
热议问题