03-03-2019 02:56 PM
03-03-2019 02:56 PM
when I use
PS C:\Windows\system32> Import-Module Microsoft.Online.SharePoint.PowerShell
Import-Module : Could not load type 'Microsoft.SharePoint.Administration.DesignPackageType' from assembly 'Microsoft.SharePoint.Client, Version=18.104.22.168, Culture=neutral,
At line:1 char:1
+ Import-Module Microsoft.Online.SharePoint.PowerShell
+ CategoryInfo : NotSpecified: (:) [Import-Module], TypeLoadException
+ FullyQualifiedErrorId : System.TypeLoadException,Microsoft.PowerShell.Commands.ImportModuleCommand
I have this binary module installed:
Directory: C:\Program Files\WindowsPowerShell\Modules
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Binary 16.0.86... Microsoft.Online.SharePoint.Powe...
Binary 16.0.80... Microsoft.Online.SharePoint.Powe...
03-03-2019 10:59 PM
09-24-2019 01:30 AM
12-24-2019 04:46 AM
I just found this thread because I was having the same problem - thank you for these instructions @Glenn Goffin, they did the trick for me!
01-13-2020 02:26 AM - edited 01-13-2020 02:27 AM
Thx @Glenn Goffin , this one worked for me !
02-17-2020 12:46 PM
I have very same error/issue trying to load on a SharePoint 2019 server. I don't think it would be a good idea to delete all the Microsoft.SharePoint assemblies from this server. Any ideas if it will corrupt the SharePoint installation?
04-03-2020 08:13 AM
@Glenn Goffin Thanks for your help! It worked for me.
What are those assemblies for in C:\Windows\Microsoft.NET\assembly\GAC_MSIL ?
04-22-2020 09:21 AM
@Glenn Goffin I don't think direct manipulation of dlls in the GAC is the right solution here. This issue is actually caused by a conflict with SharePoint Online Components SDK. Recent versions of the Microsoft.Online.SharePoint.PowerShell module simply will not load as long as that is installed on a system. If you uninstall SharePoint Online Components, the module will load just fine.
05-12-2020 05:13 AM
would be also very interesting for me whether "clearing" the GAC destroys SharePoint Server installation.
08-13-2020 03:25 PM
@Kirk Munro although I strongly agree with your cautious approach to this, I wanted to note that my various attempts to uninstall the SharePoint Online Components (e.g. initial uninstall = no luck. re-install and uninstall using elevated command prompt = no luck) never did the trick. Using @Glenn Goffin 's GAC "nuclear option" was what finally did the trick for me.
I assume the SOC components came in from my Visual Studio 2019 install since I don't know how else they got installed, btw. But for now, adios SOC/COSM dlls.
So, Kirk, your warnings may be especially important for those (unlike me) who are doing ShPt dev work.
09-29-2020 03:48 AM
Manual removing CSOM assemblies from the GAC is not a good idea - especially if you have SP on-prem running on the same server. Problem is caused by several instances of SPO SDKs and may be solved this way:
1. Open Control Panel -> UnInstall Programs -> Search for SharePoint related setups.
2. Locate SharePoint Client Components -> Uninstall.
3. Locate SharePoint Online Management Shell -> Uninstall.
4. Ensure that anyone of the above setup is installed more than one time. If so, remove all the instances.
5. Now, open the Powershell console in administrative mode (Run as administrator).
6. Uninstall SPO Powershell module (If already exists) by running this command: Uninstall-Module -Name Microsoft.Online.SharePoint.PowerShell -AllVersions -Force
7. Finally, install the latest SPO Powershell module by running this command: Install-Module Microsoft.Online.SharePoint.PowerShell -Force
10-06-2020 12:59 PM
Thank you so much for your post. It has just worked for me after a lot of getting annoyed at powershell!