-
Notifications
You must be signed in to change notification settings - Fork 749
Open
Labels
Crashwhenever user reports a crash or app freezewhenever user reports a crash or app freezearea-ErrorHandlingIssues related to error reporting and debuggingIssues related to error reporting and debugging
Description
Describe the bug
This is a regression in version 1.7 where an exception thrown from an async method crashes the entire app even if unhandled exceptions are handled by the App class.
Steps to reproduce the bug
When this method is run as a result of a click from the UI, it will crash the entire app. (It works fine if the method is not async).
private async void BrowseForFilesSettingsCard_Click(object sender, RoutedEventArgs e)
{
throw new InvalidOperationException("test");
}
even though the App class is set to capture it
this.UnhandledException += App_UnhandledException;
private async void App_UnhandledException(object sender, Microsoft.UI.Xaml.UnhandledExceptionEventArgs e)
{
Logger.Write(ErrorWriter.FormatException(e.Exception));
e.Handled = true;
await ShowErrorDialogAsync(e.Exception);
}
Expected behavior
The unhandled exception event handler in the app class must catch it and log the error.
This problem doesn't happen in version 1.6.250228001
Screenshots
No response
NuGet package version
Windows App SDK 1.7.0: 1.7.250310001
Packaging type
Packaged (MSIX)
Windows version
Windows 11 version 24H2 (22621, October 2024 Update)
IDE
Visual Studio 2022-preview
Additional context
No response
riverar, tipa, FlashyDJ, jeremy-visionaid and BaY1251
Metadata
Metadata
Assignees
Labels
Crashwhenever user reports a crash or app freezewhenever user reports a crash or app freezearea-ErrorHandlingIssues related to error reporting and debuggingIssues related to error reporting and debugging