I am navigating through some 700K lines of code. A lot of interface implementation and DI usage. I am trying to figure out where a particular method is getting called from, hence I am trying to use [CallerMemberName]
.
All the examples I see on google etc are something like this:
public void TraceMessage(string message,
[System.Runtime.CompilerServices.CallerMemberName] string memberName = "",
[System.Runtime.CompilerServices.CallerFilePath] string sourceFilePath = "",
[System.Runtime.CompilerServices.CallerLineNumber] int sourceLineNumber = 0)
Where optional parms are used to get the info. My problem is that this method is part of an interface implementation. So, when I change the method signature the compiler is yelling at me.
Any suggestions on how to make an interface method play nice with [CallerMembername]
would be greatly appreciated.