-
Notifications
You must be signed in to change notification settings - Fork 677
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
Unhandled exception crashes App, but only if originating from async method #6304
Comments
Related #6153 |
This is more closely a duplicate of #5221 |
Here's another version, and as minimal as one can imagine. Use the "Blank App, Packaged (WinUI 3 in Desktop)" template with the Visual Studio configuration copied below. Edit the OnLaunched method in App.xaml.cs as follows:
Expected: App_UnhandledException is invoked. Actual: App_UnhandledException is not invoked, and the program crashes with the message "An unhandled Win32 exception occurred in [15028] Test.exe" in a window that asks you to attach a debugger. -- Installed Version: Community Visual C++ 2022 00482-90000-00000-AA995 ASP.NET and Web Tools 2019 17.2.388.21846 Azure App Service Tools v3.0.0 17.2.388.21846 C# Tools 4.2.0-4.22252.24+47cdc16a21bbb8a4aadfb666b011e2059e1be5d2 Common Azure Tools 1.10 Microsoft JVM Debugger 1.0 NuGet Package Manager 6.2.0 TypeScript Tools 17.0.10418.2001 Visual Basic Tools 4.2.0-4.22252.24+47cdc16a21bbb8a4aadfb666b011e2059e1be5d2 Visual F# Tools 17.1.0-beta.22178.3+6da0245a7ce4bb8483b8d1f2993c8ecaea967ad9 Visual Studio IntelliCode 2.2 |
Describe the bug
If and exception occurs in an async method (button click event for example). It cannot be handled by App.UnhandledException and it will crash the app.
If and exception occurs in an void method( button click event for examp). It can be be handled by App.UnhandledException.
Steps to reproduce the bug
Expected behavior
Both async and void method should route exception to UnhandledException in app.
Should never ever ever crash an app due to an unhandled exception. This makes a horrid user experience.
Screenshots
No response
NuGet package version
No response
Windows app type
Device form factor
Desktop
Windows version
May 2021 Update (19043)
Additional context
No response
The text was updated successfully, but these errors were encountered: