Get Name of the calling method using Reflection in C#

using System.Diagnostics;
 
// get call stack
StackTrace stackTrace = new StackTrace();
 
// get calling method name
Console.WriteLine(stackTrace.GetFrame(1).GetMethod().Name);
Share Article/Example:
  • Facebook
  • Twitter
  • del.icio.us
  • Digg
  • DotNetKicks
  • DZone