C# stack traces take the following form:
at Foo.Core.Test.FinalMethod(Doh doh) in C:\\Projects\\src\\Core.Tests\\Test.cs:line 21
at Foo.Core.Test.Anoth
StackTraceParser can parse a stack trace text output (e.g. typically returned by Environment.StackTrace or Exception.StackTrace) back into a sequence of stack trace frames, including the following components:
Type
Method
Parameter types and names
File and line information, if present
It is available as a NuGet source package that directly embeds into a C# project.
However it requires a few functions to specify and it's usage is not immediately obvious.
public static IEnumerable Parse(
string text,
Func tokenSelector,
Func methodSelector,
Func parameterSelector,
Func, TParameters> parametersSelector,
Func sourceLocationSelector,
Func selector)
See examples in https://github.com/atifaziz/StackTraceParser and https://bitbucket.org/project-elmah/main/src/2a6b0b5916a6b4913ca5af4c22c4e4fc69f1260d/src/Elmah.AspNet/ErrorDetailPage.cs?at=default&fileviewer=file-view-default