How can I make VS break on exceptions in an async Task, without breaking on all exceptions?

前端 未结 5 700
小蘑菇
小蘑菇 2021-02-01 15:06

As indicated here and here, exceptions occuring in an async Task are technically not unhandled.

This is particularly nasty when working with MVC. It actually took us a w

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-01 15:34

    You could add a handler for TaskScheduler.UnobservedTaskException.

    However, perhaps you've already tried that and you want a way to make the debugger break at the original exception rather than in the unobserved task exception handler.

提交回复
热议问题