Issue
I was recently required to use SharePoint Management shell to run some O365 PowerShell commands. But as soon as I run the SharePoint Management shell in administrative mode, I received the below error:
Could not load type 'Microsoft.SharePoint.Client.Publishing.PortalLaunch.PortalLaunchRedirectionType' from assembly 'Microsoft.SharePoint.Client.Publishing, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'.
I have gone through many links that tell me to uninstall the assembly and reinstall, but I didn’t find the exact step-by-step guide. So, I am writing this blog to provide a step-by-step guide in case someone else might face such an issue.
Resolution
The reason for this error is conflicts between different versions of Sharepoint Online SDKs (SharePoint Client Components, SharePoint Online Management Shell). So correct way to solve this problem is the following:
When you start the SharePoint Online Management Shell as administrator, you will not face the error.
Reference
- http://sadomovalex.blogspot.com/2020/09/how-to-fix-error-could-not-load-type.html