The collection type 'Microsoft.Graph.IGraphServiceUsersCollectionPage' on 'Microsoft.Graph.GraphServiceUsersCollectionResponse.Value' is not supported

后端 未结 3 891
無奈伤痛
無奈伤痛 2021-01-27 01:05

I am trying to get list of Azure AD B2C users based on code sample provided Here.

GraphServiceClient graphClient = new GraphServiceClient( authProvider );

var us         


        
相关标签:
3条回答
  • 2021-01-27 01:38

    Weirdly enough, I ran into this problem when I upgraded the following packages:

    1. Microsoft.Graph
    2. Microsoft.Graph.Core

    Initially, I was not sure why this error would have occurred.

    To resolve it, I first tried Uwe Kleim's solution and ran Update-Package -Reinstall. That did not work, but it did reinstall the package, so it may have helped (keep reading).

    Next, I reverted the upgrade on the packages. I reverted Microsoft.Graph first and then did a rebuild. The problem still existed. So, I reverted the upgrade on Microsoft.Graph.Core and the problem went away. I then upgraded Microsoft.Graph and then did a rebuild. This time, the error went away AND when I went to upgrade Microsoft.Graph.Core, it was not available to be upgraded. So, it must have been upgraded with Microsoft.Graph.

    My best bet as to the root cause: I upgraded the packages in the wrong order and Visual Studio did not like that.

    0 讨论(0)
  • 2021-01-27 01:45

    I've had the exact same problem today but I updated all NuGet packages to latest pre-release versions and it's now working.

    0 讨论(0)
  • 2021-01-27 01:57

    Today, I had the same error, although I already had the latest pre-release packages installed.

    I discovered that I recently explicitely installed the "Microsoft.Graph.Core" NuGet package.

    Usually, this package is implicitely installed by "Microsoft.Graph.Auth" and "Microsoft.Graph.Beta".

    I removed the explicitely installed NuGet package "Microsoft.Graph.Core" and then did the following call in the Package Manager Console in Visual Studio 2019:

    Update-Package -Reinstall
    

    After a rebuld of my project, the error went away.

    0 讨论(0)
提交回复
热议问题