Forum Discussion
Error when using PnP powershell and CSOM
Initially this feels like a conflict between the various versions of the CSOM sdk. The PnP Cmdlets come with the CSOM SDK included, so you don't have to install that SDK. The downloadable SDK is most likely also older than the one that comes with the PnP Cmdlets (the PnP cmdlets are always using the latest SDK, usually before the downloadable package is updated by MS). My initial try would be to uninstall the SDK (which installs the SDK into the GAC, which is generally a 'bad' thing).
- Shubhanshu RajoriyaApr 03, 2019Former Employee
Erwin van Hunen I uninstalled SPO Client Component SDK but still getting the same error.
- DeletedDec 05, 2016
Thanks for the reply!
I will uninstall the "SharePoint Client Component".
Can I still use the "SharePoint Online Management shell", or can it also cause a conflict?Good to know about the latest SDK being included in the PnP package.
Regards
Simon
- Dec 05, 2016
You can absolutely still use the SharePoint Online Management shell. One of the reasons we renamed the cmdlets from *-SPO* to *-PnP* is to be able to use them side by side without conflicts.
- DeletedDec 05, 2016
SharePoint Online Management Shell loaded/tried to load the 16.0.0.0 version of the .dll:s
I deleted the dlls and just didn't care about the error message:Import-Module : Could not load file or assembly 'Microsoft.SharePoint.Client, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified. At line:1 char:1 + Import-Module Microsoft.Online.SharePoint.PowerShell -DisableNameChec ...
Then I tried a simple (that worked):
[Microsoft.SharePoint.Client.Web]$web = Get-PnPWeb
So indeed it was a .dll mismatch, but why did SharePoint Management Shell try to load so old assemblies?
/Simon