get caller member name,caller file path,caller line number via attributes
using System.Runtime.CompilerServices; static void AttributesDemo([CallerMemberName] string memberName = null, [CallerFilePath] string filePath = null, [CallerLineNumber] int lineNumber=0) { Console.WriteLine(memberName); Console.WriteLine(filePath); Console.WriteLine(lineNumber); }