I am trying to get list of Azure AD B2C users based on code sample provided Here.
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var us
Weirdly enough, I ran into this problem when I upgraded the following packages:
Microsoft.Graph
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.
I've had the exact same problem today but I updated all NuGet packages to latest pre-release versions and it's now working.
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.