CallerMemberName not working in AzureFunctionsVersion v4

Viewed 42

I have an Azure function using AzureFunctionsVersion v3 and CallerMemberName is working. Another function is AzureFunctionsVersion v4 and using the same code, CallerMemberName is empty:

public async Task TheMethod(dynamic messageJSON, [CallerMemberName] string callerMemberName = "")

The method is two deep in a call:

ProcessMessage(string messageText, [CallerMemberName] string callerMemberName = "")
{
  // callerMemberName in ProcessMessage works
  // callerMemberName in TheMethod is ""
  TheMethod(messageText);
}

Is there something different about AzureFunctionsVersion v4 ?

1 Answers

The following documentation shows difference between v3 and v4.

The main difference would be that v3 use .NET core3.1 and v4 use .NET6 .

But according the following documentation of .netcore3.1 and .net6 the implementation of using CallerMemberName to obtain the method or property name of the caller to the method remains the same .

Related