I suggest you ...

Break debugger on exception throws from async method, optionally even when it is caught by external code

This suggestion is migrated to Developer Community. Please use below link to view the current status.
https://developercommunity.visualstudio.com/content/idea/351769/break-debugger-on-exception-throws-from-async-meth.html
## Consider following code:

Task.Run(() => throw new Exception("This breaks the debugger, fine"));
Task.Run(async () => throw new Exception("This doesn't, but should break"));

## Motivation:

It is difficult to trace some exception thrown in async methods, especially when the method is invoked by external code, like async controller action methods in asp.net core, or async handler method in some messaging framework.

Notice, that even if the exception might be cought by some external code (e.g. asp.net core's middleware), I still might want to break the designer in my code where the exception was thrown.

I know that technically the exception is handled, but come with SOME solution to improve debugging experience.

Related issues:

1. https://stackoverflow.com/questions/18084983/debugger-not-breaking-stopping-for-exceptions-in-async-method

2. https://stackoverflow.com/questions/52623543/how-to-debug-exeptions-thrown-in-rebus-handlers/52624482

4 votes
Vote
Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
You have left! (?) (thinking…)
liero shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

1 comment

Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
Submitting...

Feedback and Knowledge Base