Im trying to add some analytics and crash logging to our app, so am implementing the app center since it seems like the perfect fit. We're running xamarin forms targeting iOS/Android/UWP.
I'm trying to add some exception handling in our shared project to throw the exception information up to the appCenter. When i add the following to one of our exceptions:
Crashes.TrackError(ex);
I get a warning saying:
'Crashes.TrackError(Exception, IDictionary<string, string>)' is obsolete: 'This does not exist in UWP and should not be used.'
What should we be using in it's place to pass out the exception to the appcenter for all platforms?
Microsoft AppCenter does not currently support the same API feature set on UWP vs Xamarin so TrackError is not available (March+ timeframe) ((As Guillaume Perrot answer stated and linked GitHub issue highlights).
Important
UWP only supports starting Crashes with AppCenter.Start and none of the other API calls provided by the Crashes class are supported on UWP, They only work for Xamarin.iOS, Xamarin.Android and Xamarin.Forms apps deployed to iOS and Android.
re: https://learn.microsoft.com/en-us/appcenter/sdk/crashes/uwp
You could use App Center's Analytics as a stop-gap and define a custom Event (HandledException
) and use the TrackEvent name/event properties to track your handled exceptions (it only supports 125 chars per name/event, but better then nothing).