I am trying to get list of Azure AD B2C users based on code sample provided Here.
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var users = await graphClient.Users
.Request()
.GetAsync();
Which is loading users as expected when I try with .Net core console application or .Net core web application. But I need to load users in .net core class library project. (Azure function project to be specific). But same code in .net core class library throws below expection while fetching user.
System.Private.CoreLib: Exception while executing function: MainFunction. System.Text.Json: The collection type 'Microsoft.Graph.IGraphServiceUsersCollectionPage' on 'Microsoft.Graph.GraphServiceUsersCollectionResponse.Value' is not supported.
I could not figure out any document or cause related to this error. Can anybody help me with this?