Can you use reflection to find the name of the currently executing method?

For non-async methods one can use

System.Reflection.MethodBase.GetCurrentMethod().Name;

https://docs.microsoft.com/en-us/dotnet/api/system.reflection.methodbase.getcurrentmethod

Please remember that for async methods it will return “MoveNext”.

Leave a Comment