-
Notifications
You must be signed in to change notification settings - Fork 689
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Debugger cannot display callstack for exception thrown from "async" method #1582
Comments
The seems to be working before I updated to either the latest version of VSC, or the latest version of C# extension. |
@llint there are actually a bunch of different layers to this. First, your expected behavior isn't something that is possible. Short summary: exceptions thrown from an async method which returns a Task are not considered 'user unhandled'. Explanation (if you care why): There is a design flaw, from a tooling perspective (its good in other ways), with System.Task. That flaw is that it is common for callers of an async method to not have signed up to listen for the result of that async method at the time that said async method starts executing asynchronously. This makes it impossible to decide, at the time an exception is thrown from an async method, if any user code will wind up handling that exception. Next, the 'actual behavior' you are seeing is still clearly very broken. This is due to a couple of different problems with VS Code. The good news is something that the VS Code team fixed recently (microsoft/vscode#27903). This results in a far less confusing behavior in current insiders builds (see screen capture at the end). From there you can evaluate In addition, there two other remaining issues:
|
I am going to resolve this as 'External' since the primary bugs are with VS Code. |
Thanks Gregg! |
Environment data
dotnet --info
output:VS Code version:
1.13.1
C# Extension version:
1.10.0
Steps to reproduce
Create a new dotnet console project, restore it normally, and have it open under visual studio code, and consent to add C# debugging support for the project inside VSC.
Replace the generated
Program.cs
with the code belowMake sure "User-Unhandled Exceptions"is ticked, leaving "All Exceptions" unticked
Start debugging through the debug menu within VSC
Expected behavior
When debugging under the debugger, the exception thrown from within
TestException
should pause the debugger, and full stack information should be shown, as well as the file/line information, and local variables, etc..Actual behavior
When debugging under the debugger, the debugger is paused due to the exception thrown within
TestException
, but no callstack information can be found through the debugger displays, except that only two threads (on my Mac) are shown, but lacking the stack information for each thread.The text was updated successfully, but these errors were encountered: