When logging in C#, how can I learn the name of the method that called the current method? I know all about System.Reflection.MethodBase.GetCurrentMethod(), but
System.Reflection.MethodBase.GetCurrentMethod()
For getting Method Name and Class Name try this:
public static void Call() { StackTrace stackTrace = new StackTrace(); var methodName = stackTrace.GetFrame(1).GetMethod(); var className = methodName.DeclaringType.Name.ToString(); Console.WriteLine(methodName.Name + "*****" + className ); }