Error and crash reporting

  • Latest Dynatrace
  • Explanation
  • 1-min read
  • Published Dec 24, 2025

Dynatrace provides comprehensive error and crash reporting for .NET MAUI applications. The native OneAgent automatically captures unhandled exceptions and platform-level crashes on both Android and iOS platforms.

Automatic crash reporting

When you configure the Dynatrace MAUI plugin, automatic crash reporting is turned on by default. The native OneAgents capture crashes from the underlying Android and iOS platforms.

How it works

The native OneAgents automatically capture:

  • Unhandled exceptions—fatal errors that cause application termination.
  • Native crashes—platform-level crashes from Android and iOS.

Turn off automatic crash reporting

Automatic crash reporting is turned on by default. If you prefer to turn it off, you can configure it in the dynatrace.config.json file.

Android:

{
"android": {
"crashReporting": false
}
}

iOS:

{
"ios": {
"DTXCrashReportingEnabled": false
}
}

ANR reporting

Application Not Responding (ANR) errors occur when the main thread is blocked for too long. Dynatrace automatically captures ANR events.

What is captured

ANR events indicate that your app's UI became unresponsive.

Configuration

ANR reporting is turned on by default. To turn it off in your dynatrace.config.json file:

Android:

{
"android": {
"anrReporting": false
}
}

iOS:

{
"ios": {
"DTXANRReportingEnabled": false
}
}

ANR events are only sent if the user restarts the app within 10 minutes of the ANR occurring. On Android, ANR reporting requires Android 11 or higher.

Manual error reporting

Report exception events

Use SendExceptionEvent() to report exceptions with full context and custom properties. The exception object is required; all other fields are optional.

using Dynatrace.MAUI;
try
{
// Your code that might throw an exception
PerformRiskyOperation();
}
catch (Exception exception)
{
var exceptionEventData = new ExceptionEventData(exception);
Agent.Instance.SendExceptionEvent(exceptionEventData);
}

Add custom properties

You can add context to exception events to help with debugging:

using Dynatrace.MAUI;
try
{
await FetchUserData(userId);
}
catch (Exception exception)
{
var exceptionEventData = new ExceptionEventData(exception)
.AddEventProperty("event_properties.operation", "fetch_user_data")
.AddEventProperty("event_properties.user_id_hash", userId.GetHashCode())
.AddEventProperty("event_properties.retry_count", retryCount);
Agent.Instance.SendExceptionEvent(exceptionEventData);
}

Report errors

You can use the IAction.ReportError API to manually report errors in your application. This allows you to capture and send custom error information to Dynatrace.

Example

using Dynatrace.MAUI;
try
{
// Your code that might throw an exception
PerformRiskyOperation();
}
catch (Exception ex)
{
// Report the error to Dynatrace
IRootAction action = Agent.Instance.EnterAction("ParentAction");
action.ReportError("Custom error occurred", -1);
action.LeaveAction();
}

The ReportError API forwards data to Grail. The Android and iOS agents generate RUM on Grail data from this API, which means the error data will not pass through the event modifier in the MAUI scope.

Related tags
Digital Experience