Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# get executing method name

using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Reflection;

[MethodImpl(MethodImplOptions.NoInlining)]
public string GetCurrentMethod()
{
    var st = new StackTrace();
    var sf = st.GetFrame(1);

    return sf.GetMethod().Name;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #executing #method
ADD COMMENT
Topic
Name
3+8 =