Skip to content

Commit db46624

Browse files
author
mwatson
committed
Fix error when using core and trying to find stack frames
1 parent 4bd588e commit db46624

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Src/StackifyLib/Logger.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,11 @@ public static List<TraceFrame> GetCurrentStackTrace(string declaringClassName, i
255255
{
256256
List<TraceFrame> frames = new List<TraceFrame>();
257257

258+
#if NET45 || NET40
258259
try
259260
{
260261
//moves to the part of the trace where the declaring method starts then the other loop gets all the frames. This is to remove frames that happen within the logging library itself.
261-
StackTrace stackTrace = new StackTrace((Exception)null, false);
262+
StackTrace stackTrace = new StackTrace(true);
262263
int index1;
263264
var stackTraceFrames = stackTrace.GetFrames();
264265
for (index1 = 0; index1 < stackTraceFrames.Length; ++index1)
@@ -301,7 +302,7 @@ public static List<TraceFrame> GetCurrentStackTrace(string declaringClassName, i
301302
{
302303

303304
}
304-
305+
#endif
305306
return frames;
306307
}
307308

Src/StackifyLib/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "1.24.2",
2+
"version": "1.24.4",
33

44
"title": "Stackify API",
55

0 commit comments

Comments
 (0)