Skip to content

Include C# stack trace with ANRs #2179

@mattjohnsonpint

Description

@mattjohnsonpint

Problem Statement

The Android and iOS embedded SDKs will capture ANRs / App Hangs for MAUI apps. However, they details they capture don't include anything that will help a .NET developer identify the source of the hang. The stack trace only includes the native code.

For example, writing a button click handler like this:

private void OnHangClicked(object sender, EventArgs e)
{
    while (true)
    {
        // Hang
    }
}

on Android shows an ANR like this:

image

and on IOS shows like this:

image

... neither of which are useful to get back to the infinite loop in the C# code.

Solution Brainstorm

We might be able to capture a managed stack trace manually and include it (as an attachment?) with the native error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions