microsoft / appcenter

Central repository for App Center open source resources and planning.
https://appcenter.ms
Creative Commons Attribution 4.0 International
1.01k stars 225 forks source link

Crash Stacks / Line Numbers for Xamarin Apps #165

Open kensykora opened 5 years ago

kensykora commented 5 years ago

Crashes and errors that are collected today are really nice, but they aren't including line numbers. So when I see a crash with a stacktrace like this, it's really difficult to pinpoint exactly where the exception occurred. At best I can make an educated guess. Especially tricky when it's a very low frequency crash that we haven't been able to reproduce yet

System.NullReferenceException: Object reference not set to an instance of an object

App.MyApp.Services.BluetoothService+<>c.<ReadInitializationData>b__48_0 (App.MyApp.Member.JournalEntryModel x)
System.Linq.Enumerable.Max[TSource,TResult] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] selector)
App.MyApp.Services.BluetoothService+<ReadInitializationData>d__48.MoveNext ()
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task)
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task)
System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult ()
App.MyApp.Services.BluetoothService+<>c__DisplayClass34_0+<<InitializePuck>b__0>d.MoveNext ()

I can't think of any alternative way to achieve this behavior. We have considered shipping log data with the crashes to supplement but that only goes so far.

bruno-garcia commented 11 months ago

For those on Xamarin (https://github.com/getsentry/sentry-xamarin) MAUI (https://github.com/getsentry/sentry-dotnet) Or just native Android/iOS apps with .NET, you can get line numbers in .NET stack traces with Sentry:

https://docs.sentry.io/platforms/dotnet/guides/maui/#overview-of-the-features

You need to upload PDBs. It's automatic if you configure the org-slug/auth token via msbuild or env vars, or CLI args: https://docs.sentry.io/platforms/dotnet/guides/maui/configuration/msbuild/

Also support native crashes on both iOS and Android. Code is here: https://github.com/getsentry/sentry-dotnet

I use it on this project: https://github.com/getsentry/symbol-collector

These are release builds in production:

image

image

Disclaimer: I was the maintainer of the Sentry .NET SDK

ryanholden8 commented 6 months ago

For anybody still hoping this gets fixed, App Center is officially being retired.
https://learn.microsoft.com/en-us/appcenter/retirement

bruno-garcia commented 6 months ago

And Sentry continues to support line numbers for all types of .NET app including mobile: