StackFrame will do this as Jimmy suggested. However, beware of using a StackFrame. Creating an instance is quite expensive and depending on where exactly you create it, you may need to specify MethodImplOptions.NoInlining. If you want to complete the stack to find the caller in full function, you need to do this:
[MethodImpl(MethodImplOptions.NoInlining)] public static MethodBase GetThisCaller() { StackFrame frame = StackFrame(2);
source share