草庐IT

MyStackCrawlMark

全部标签

c# - 调用私有(private)方法保留调用栈

我正在尝试找到“闯入非公共(public)方法”的解决方案。我只想调用RuntimeMethodInfo.InternalGetCurrentMethod(...),传递我自己的参数(这样我就可以实现GetCallingMethod()),或者直接使用RuntimeMethodInfo.InternatGetCurrentMethod(refStackCrawlMark.LookForMyCaller)在我的日志例程中。GetCurrentMethod实现为:[MethodImpl(MethodImplOptions.NoInlining)]publicstaticMethodBase