dotnet / dotnet/runtime

Avalonia .NET10 Global exception handling fails on macOS

Open
#121,835 2 comments 0 reactions 1 assignee Claimed by @VSadov View on GitHub
area-VM-coreclr
Dominant language
C#
Stars
18.3k
Forks
5.6k
PR merge metrics
PR metrics pending

Description

I attached two exception listener events in App.axaml.cs. They work well on the Windows system, capturing exceptions from anywhere and logging them. However, when I debug on macOS, program crashes are not caught by these events.

`AppDomain.CurrentDomain.UnhandledException += (sender, e) =>
{
if (e.ExceptionObject is Exception ex)
HandleUnhandledException(ex, "AppDomain.UnhandledException");
};
TaskScheduler.UnobservedTaskException += (sender, e) =>
{
HandleUnhandledException(e.Exception, "TaskScheduler.UnobservedTaskException");
};`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.