Skip to content

Support Global Exception Handling Mechanism for .NET MAUI #5535

@TanayParikh

Description

@TanayParikh

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

Metadata

Metadata

Labels

area-core-hostingExtensions / Hosting / AppBuilder / Startuppartner/cat 😻this is an issue that impacts one of our partners or a customer our advisory team is engaged witht/enhancement ☀️New feature or request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions