Closed kpinel closed 7 months ago
Hi @kpinel thank you for identifying and logging this issue and also providing a work around. The reason you are having that error is because of a conflict in the Microsoft.Graph.Core assemblies loaded in your session. pnp.PowerShell is using an old version (1.25.1.0) while Microsoft.Graph.PowerShell is using a newer version (3.0.9). I would suggest that you log this issue here https://github.com/pnp/powershell/issues, requesting that team to update their Microsoft.Graph.Core version.
As noted in my original post, I had also posted into pnp PowerShell. Closing this one and putting pressure on the PnP team
FYI, to resolve this I just deleted the Microsoft.Grap.Core.dll in the PNP module folder. All works now.
I am using modules: PnP.PowerShell 2.5.0 Microsoft.Graph 2.21.1
I have had similar issues in the past where one module was updated and the others weren't.
Describe the bug When loading the latest versions of PnP.PowerShell and Graph and running any Graph query, we get the following error Could not load type 'Microsoft.Graph.Authentication.AzureIdentityAccessTokenProvider' from assembly 'Microsoft.Graph.Core
To Reproduce Steps to reproduce the behavior:
Connect-MgGraph: InteractiveBrowserCredential authentication failed: Could not load type 'Microsoft.Identity.Client.BaseAbstractApplicationBuilder'1' from assembly 'Microsoft.Identity.Client, Version=4.50.0.0, Culture=neutral, PublicKeyToken
Load graph first
Expected behavior Expect both modules to be able to work together
Debug Output
Module Version
Environment Data
Additional context Also reporting the same bug in PnP.PowerShell just in case
Workaround
Connect-MgGraph Perform graph command Connect-PnPOnline
Commands from both modules seem to work after this