Answer: A
Option A is correct. Within your error handling code, like a try/catch block, you can call a Crashes.TrackError method sends the details to the App Center without letting your app crash. This manual error data collection is currently only available to apps using the Xamarin, Unity, WPF, and WinForms SDKs. Automatic data collection by the App center cannot collect this data from the app unless the user relaunches the app.
Option B is incorrect. This will not help to collect the exception details. Instead, this helps to decide if a crash needs to be processed or not. For example, there could be a system level crash that you had wanted to ignore and that you do not want to send to the App Center. You can set ‘ShouldProcessErrorReport’ to false if you`re going to send the details to the App Center, set to true.
Option C is incorrect. ‘ShouldAwaitUserConfirmation’ is to ask for the user’s consent to send a crash log. This tells App Center Crashes to await user confirmation before sending any crash reports. If you choose to do so, you are responsible for obtaining the user`s confirmation, e.g., through a dialog prompt with one of the following options: Always Send, Send, and Don`t send. Usage of this is for sending crash reports, not for collecting exception details to avoid the crash.
Option D is incorrect. ‘Crashes.SetEnabledAsync’ is used for enabling or disabling App Center Crashes at runtime. If you set this to false, the SDK will not do any crash reporting for the app unless you set it back to true. Enabling or disabling the crash reporting would not help in this scenario.
Reference Links: For more information on App Center and Crashing integration, please refer to the below links from Microsoft-
https://docs.microsoft.com/en-us/learn/modules/intro-to-app-center/
https://docs.microsoft.com/en-us/appcenter/sdk/