Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PnP Powershell throws 0x80131621 error in VS Code #4789

Closed
5 of 6 tasks
all2001 opened this issue Oct 19, 2023 · 1 comment
Closed
5 of 6 tasks

PnP Powershell throws 0x80131621 error in VS Code #4789

all2001 opened this issue Oct 19, 2023 · 1 comment
Labels
Resolution-Duplicate Will close automatically.

Comments

@all2001
Copy link

all2001 commented Oct 19, 2023

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all open and closed issues to ensure it has not already been reported.
  • I have read the troubleshooting guide.
  • I am sure this issue is with the extension itself and does not reproduce in a standalone PowerShell instance.
  • I have verified that I am using the latest version of Visual Studio Code and the PowerShell extension.
  • If this is a security issue, I have read the security issue reporting guidance.

Summary

VS Code Version - 1.84.0-insider (also tried with 1.83.1)
VS Code Powershell Extension - v2023.8.0
Powershell version - 7.3.8
PnP.Powershell module version - 2.2

I have a script that has the following:
Connect-PnPOnline -Url -ClientId -Tenant <tenant-id>
-Thumbprint

Connect-MicrosoftTeams -TenantId <tenant-id> `
    -CertificateThumbprint <cert-thumbprint> `
    -ApplicationId <app-id2>

Connect-MgGraph -ClientId <app-id3> -TenantId <tenant-id> -CertificateThumbprint <cert-thumbprint>

This script fails on the first command with the following error:
Connect-PnPOnline: Could not load file or assembly 'Microsoft.Identity.Client, Version=4.50.0.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae'. Could not find or load a specific file. (0x80131621)

This issue is in VS Code only, when I do the same in native Powershell terminal - it works fine.

PowerShell Version

Name                           Value
----                           -----
PSVersion                      7.3.8
PSEdition                      Core
GitCommitId                    7.3.8
OS                             Microsoft Windows 10.0.19045
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visual Studio Code Version

1.84.0-insider
c42f8961f9ba803175ccbb8260e8d70d561f8bee
x64

also tried with 1.83.1 with the same result

Extension Version

Steps to Reproduce

VS Code Version - 1.84.0-insider (also tried with 1.83.1)
VS Code Powershell Extension - v2023.8.0
Powershell version - 7.3.8
PnP.Powershell module version - 2.2

I have a script that has the following:

Connect-PnPOnline -Url  <spo-site> -ClientId <app-id> `
    -Tenant <tenant-id> `
    -Thumbprint <cert-thumbprint>

Connect-MicrosoftTeams -TenantId <tenant-id> `
    -CertificateThumbprint <cert-thumbprint> `
    -ApplicationId <app-id2>

Connect-MgGraph -ClientId <app-id3> -TenantId <tenant-id> -CertificateThumbprint <cert-thumbprint>

This script fails on the first command with the following error:
Connect-PnPOnline: Could not load file or assembly 'Microsoft.Identity.Client, Version=4.50.0.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae'. Could not find or load a specific file. (0x80131621)

This issue is in VS Code only, when I do the same in native Powershell terminal - it works fine.

Visuals

image

Logs

No response

@all2001 all2001 added the Issue-Bug A bug to squash. label Oct 19, 2023
@andyleejordan
Copy link
Member

Please see the pinned issue and ask the PnP.PowerShell devs to fix their module: #3510 In short, they isolated a couple dependencies but not all their dependencies, which causes Microsoft.Identity.Client to conflict with many other modules like ExchangeOnline etc.)

@SydneyhSmith SydneyhSmith added Resolution-Duplicate Will close automatically. and removed Issue-Bug A bug to squash. labels Oct 19, 2023
@all2001 all2001 closed this as completed Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution-Duplicate Will close automatically.
Projects
None yet
Development

No branches or pull requests

3 participants