-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
Discussed in #653
Originally posted by AmSmart April 5, 2021
With the new host model in .NET Maui, will we get a straightforward way of catching exceptions?
Currently this is possible in WPF/WinForms via:
AppDomain.CurrentDomain.UnhandledException += (sender, error) =>
{
MessageBox.Show(text: error.ExceptionObject.ToString(), caption: "Error");
};The ask of this issue is to enable AppDomain.CurrentDomain.UnhandledException for MAUI based applications to support a global exception handling mechanism.
I looked into the Windows MAUI WinUI3 end of things, and there appears to be a potential bug with the DispatcherQueue which prevents the application from being sent to the AppDomain.CurrentDomain.UnhandledException: microsoft/microsoft-ui-xaml#5221
cc/ @hartez @mattleibow
Blazor Hybrid
Cross linking dotnet/aspnetcore#40765 which handles the case of WPF/WinForms in Blazor Hybrid. If there's a canonical way to do global exception handling (like we have in WinForms/WPF), we need to ensure .NET MAUI Blazor Hybrid is able to integrate with it directly.
Blazor Hybrid MAUI tracking issue: #4441
- WPF/WinForms Blazor WebView Exception Handling aspnetcore#40765
- App.UnhandledException doesn't catch exceptions from other threads. microsoft/microsoft-ui-xaml#5221
- [Blazor webview] Exception handling for blazor webview #4441
- MAUI: enable AppDomain.CurrentDomain.UnhandledException for MAUI based applications to support a global exception handling mechanism