Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 97327

Unable to Use SharePoint PNP PowerShell in VSCode

$
0
0

Running this command in VScode doesn't work but it works in PowerShellPlus.

Connect-PnPOnline -Url "https://something.sharepoint.com/" -Credentials $userCredential

Error:

   System.MissingMethodException: Method not found: 'System.Runtime.Remoting.ObjectHandle System.Activator.CreateInstance(System.String, System.String)'.
   at SharePointPnP.PowerShell.Commands.Base.ConnectOnline.ProcessRecord()
   at System.Management.Automation.CommandProcessor.ProcessRecord()

I've tried uninstalling VScode and removing any trace of SharePoint my machine but I'm not able to get past this error. Any ideas?

Edit: Following this blog post, I removed and reinstalled the SP PNP module. https://www.toddklindt.com/blog/Lists/Posts/Post.aspx?ID=802

  1. Delete all the SharePoint Components from the Control Panel (Add/Remove)
  2. Open the GAC location (C:\windows\Microsoft.NET\assembly\GAC_MSIL), search for the term SharePoint and delete all the folders. (This is required since the reference is still old which is used by the PnP commands)
  3. Re-Start the machine
  4. Install the latest version of the SharePoint PnP

Viewing all articles
Browse latest Browse all 97327

Trending Articles