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
- Delete all the SharePoint Components from the Control Panel (Add/Remove)
- 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)
- Re-Start the machine
- Install the latest version of the SharePoint PnP