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.
When you configure the Dynatrace MAUI plugin, automatic crash reporting is enabled by default. The native agents capture crashes from the underlying Android and iOS platforms.
The native agents automatically capture:
Automatic crash reporting is enabled by default. If you prefer to disable it, you can configure it in the dynatrace.config.json file.
Android:
{"android": {"crashReporting": false}}
iOS:
{"ios": {"DTXCrashReportingEnabled": false}}
Application Not Responding (ANR) errors occur when the main thread is blocked for too long. Dynatrace automatically captures ANR events.
ANR events indicate that your app's UI became unresponsive.
ANR reporting is enabled by default. To disable it 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.
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.
using Dynatrace.MAUI;try{// Your code that might throw an exceptionPerformRiskyOperation();}catch (Exception ex){// Report the error to DynatraceIRootAction 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.