How can I constructs a stack trace from the current location?
In .NET 4.5 works this solution:
System.Diagnostics.StackTrace stackTrace = new System.Diagnostics.StackTrace(true);
for (int i = 0; i < stackTrace.FrameCount; ++i)
{
System.Diagnostics.StackFrame frame = stackTrace.GetFrame(i);
MethodBase callerMethod = frame.GetMethod();
...
}
But what is the solution in .NET Core?
The constructor public StackTrace(bool fNeedFileInfo)
does not exists anymore.