.NET Stack trace
pradeep
Posted on
Sep 16 2022
We have integrated crash reporting of our WPF application, and the report has stack trace like this
MatterManagement.ManageFiles2.Wpf.Services.FilesService.CheckFileInUse(String fileId):292
MatterManagement.ManageFiles2.Wpf.Services.FilesService+<RequestOpenFile>d__146.MoveNext():71
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw():12
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task):40
System.Runtime.CompilerServices.TaskAwaiter.GetResult():11
MatterManagement.ManageFiles2.Wpf.ViewModels.FileListViewModel+<>c__DisplayClass86_0+<<-ctor>b__3>d.MoveNext():254
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw():12
System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs):142
System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler):2
Now what I am trying to understand is there is no PDB file in the executable folder, So wondering what is this number next to the method name? If that is ILOffset then is it showing in hex or decimal?
Also the Custom doesn't show any of these numbers so I assume the exception thrown doesn't have any numbers and RayGun appender is adding this to the Stacktrace.
Thanks
Jason Fauchelle
Raygun
Posted on
Sep 16 2022
Hi Pradeep,
Thanks for getting in touch. When a stack trace has no line numbers, such as the case with no PDB being available, the Raygun4Net provider will send the ILOffset instead as you've suspected. These are displayed as decimal not hex. A bit misleadingly, these numbers get stored on the "LineNumber" property of the Raygun crash report payload (which you can see by clicking on the "Raw" tab of a crash report displayed in Raygun).
Here is the source code of the Raygun4Net provider where this ILOffset is being picked up: https://github.com/MindscapeHQ/raygun4net/blob/master/Mindscape.Raygun4Net/Builders/RaygunErrorMessageBuilder.cs#L70
Let us know if you have further questions on this.
Regards
-Jason Fauchelle
pradeep
Posted on
Sep 16 2022
Thanks Jason,
In .net the StackTrace property formats the stack trace information for each method call as follows:
"at FullClassName.MethodName(MethodParams) in FileName :line LineNumber "
- I am wondering is there a document which shows the format in which the stack trace is shown in RayGun?
- Is there a way to show correct line numbers for specific version using PDB files? (Please note the we don't want to include PDB along with installation)
Jason Fauchelle
Raygun
Posted on
Sep 18 2022
Hey Pradeep,
- There is no document mentioning the .NET stack trace format Raygun uses sorry. The format would be:
"FullClassName.MethodName(MethodParams) in FilePath:{LineNumber|ILOffset}"
- Currently we only have PDB processing for UWP applications. That works by uploading PDB files to your Raygun application - so you don't need to package them up with your installation. I have passed this feedback on to the Product team regarding having PDB support for other .NET application types, but don't know if/when we'd expand this support. You can also post this in the Crash Reporting Feature Requests forum where other can vote on it. Surprisingly it doesn't look like anyone else has suggested this one.
Let us know if you have further questions.
Regards
-Jason Fauchelle
pradeep
Posted on
Sep 20 2022
Hi Jason,
Thanks for the details, I already posted this in feature requests https://raygun.com/thinktank/suggestion/180276 Will come back here if I need more details.
Thanks again, Pradeeep