For some debug code I’m writing Trace code I’m trying to output the name of the method using MethodBase.GetCurrentMethod().ToString() but I also wanted to output the current methods parameter names and values. Is this possible?
For some debug code I’m writing Trace code I’m trying to output the name
Share
You can get the parameter names (and types, modifiers, attributes etc) via
MethodBase.GetParametersbut you can’t get the values that way. You may want to consider using some form of AOP (such as Postsharp) to add logging for parameter values.