登录C#时,如何学习调用当前方法的方法的名称?我知道所有这些System.Reflection.MethodBase.GetCurrentMethod(),但我想在堆栈跟踪中向下迈出一步.我考虑过解析堆栈跟踪,但我希望找到一种更清晰,更明确的方法,比如Assembly.GetCallingAssembly()方法.
System.Reflection.MethodBase.GetCurrentMethod()
Assembly.GetCallingAssembly()
.net c# logging system.diagnostics stack-trace
.net ×1
c# ×1
logging ×1
stack-trace ×1
system.diagnostics ×1