Import SharePointPnPPowerShellOnline results in error: Could not load type "OfficeDevPnP.Core..."

%3CLINGO-SUB%20id%3D%22lingo-sub-1184430%22%20slang%3D%22en-US%22%3EImport%20SharePointPnPPowerShellOnline%20results%20in%20error%3A%20Could%20not%20load%20type%20%22OfficeDevPnP.Core...%22%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1184430%22%20slang%3D%22en-US%22%3E%3CDIV%3E%3CDIV%3E%3CDIV%3E%3CDIV%3EHelp!%26nbsp%3B%20I'm%20suddenly%20getting%20an%20issue%20ONLY%20in%20VS%20Code%20and%20haven't%20been%20able%20to%20figure%20it%20out%20even%20after%20a%20bunch%20of%20RTFM%20and%20experimentation%20(including%20shutting%20it%20down%20and%20restarting).%26nbsp%3B%20While%20I%20can%20install%20SharePointPnPPowerShellOnline%2C%20when%20I%20try%20to%20import%20it%2C%20I'm%20getting%20the%20error%26nbsp%3B%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3EImport-Module%20%3A%20Could%20not%20load%20type%20'OfficeDevPnP.Core.Pages.DefaultClientSideWebParts'%20from%20assembly%20'OfficeDevPnP.Core%2C%20Version%3D3.18.2002.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D5e633289e95c321a'.%E2%80%8B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CDIV%3EAny%20ideas%3F%20I've%20been%20through%20a%20lot%20trying%20to%20get%20it%20to%20work%2C%20including%20installing%20SharePoint%20Client%20Components%2C%20Version%2016.0.6906.1200%2C%20but%20keep%20getting%20the%20same%20result.%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1190849%22%20slang%3D%22en-US%22%3ERe%3A%20Import%20SharePointPnPPowerShellOnline%20results%20in%20error%3A%20Could%20not%20load%20type%20%22OfficeDevPnP.Co%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1190849%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F259224%22%20target%3D%22_blank%22%3E%40lindabusdiecker%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EDo%20you%20have%20multiple%20version%20of%20SharePoint%20PnP%20installed%3F%20If%20yes%2C%20please%20check%20following%20article%20to%20install%20side-by-side%20SharePoint%20Pnp.%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fthechriskent.com%2F2018%2F02%2F14%2Fusing-sharepoint-pnp-powershell-modules-side-by-side-2013-2016-online%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fthechriskent.com%2F2018%2F02%2F14%2Fusing-sharepoint-pnp-powershell-modules-side-by-side-2013-2016-online%2F%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBest%20Regards%2C%3CBR%20%2F%3E%3CBR%20%2F%3ERiwut%20Libinuko%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1190876%22%20slang%3D%22en-US%22%3ERe%3A%20Import%20SharePointPnPPowerShellOnline%20results%20in%20error%3A%20Could%20not%20load%20type%20%22OfficeDevPnP.Co%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1190876%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F70806%22%20target%3D%22_blank%22%3E%40Riwut%20Libinuko%3C%2FA%3E%26nbsp%3BTHANK%20YOU%20so%20much%20for%20getting%20back%20to%20me.%20I've%20actually%20been%20running%20with%202016%20and%20Online%20for%20a%20long%20time%2C%20but%20am%20careful%20to%20have%20only%20one%20in%20memory.%26nbsp%3B%20Upgraded%20to%20Windows%201909%20and%20started%20being%20able%20to%20import%20Online%20in%20Windows%20PowerShell%20and%20in%20the%20ISE.%26nbsp%3B%20Still%20ran%20into%20the%20same%20issue%20and%20more%20in%20VS%20Code%2C%20plus%20ran%20into%20some%20other%20hokey%20stuff.%20Deinstalled%20and%20reinstalled%20VS%20Code%20and%20all%20versions%20of%20SharePointPnPPowerShellOnline.%20Still%20had%20the%20problem%2C%20again%2C%20only%20in%20VS%20Code.%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3ESwitched%20in%20VS%20Code%20from%20the%20PowerShell%20Integrated%20Console%20to%20just%20powershell%2C%20imported%20successfully%2C%20came%20back%20to%20the%20integrated%20command%20console%20and%20everything%20now%20seems%20fine%20(I'm%20scared%20to%20give%20the%20%22all%20good%22%20yet%20...).%26nbsp%3B%20Bizarre.%20Felt%20like%20I%20was%20doing%20the%20dance%20of%20100%20troubleshooting%20ideas%20and%20now%20I%20WISH%20I%20knew%20exactly%20what%20pieces%20fixed%20it%20in%20case%20it%20might%20help%20someone%20else%2C%20but%2C%20sigh%2C%20I%20don't%20know%20for%20sure.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Contributor
Help!  I'm suddenly getting an issue ONLY in VS Code and haven't been able to figure it out even after a bunch of RTFM and experimentation (including shutting it down and restarting).  While I can install SharePointPnPPowerShellOnline, when I try to import it, I'm getting the error 

 

Import-Module : Could not load type 'OfficeDevPnP.Core.Pages.DefaultClientSideWebParts' from assembly 'OfficeDevPnP.Core, Version=3.18.2002.0, Culture=neutral, PublicKeyToken=5e633289e95c321a'.​

 

Any ideas? I've been through a lot trying to get it to work, including installing SharePoint Client Components, Version 16.0.6906.1200, but keep getting the same result.
2 Replies

Hi @lindabusdiecker ,

 

Do you have multiple version of SharePoint PnP installed? If yes, please check following article to install side-by-side SharePoint Pnp.

https://thechriskent.com/2018/02/14/using-sharepoint-pnp-powershell-modules-side-by-side-2013-2016-o...

 

Best Regards,

Riwut Libinuko

@Riwut Libinuko THANK YOU so much for getting back to me. I've actually been running with 2016 and Online for a long time, but am careful to have only one in memory.  Upgraded to Windows 1909 and started being able to import Online in Windows PowerShell and in the ISE.  Still ran into the same issue and more in VS Code, plus ran into some other hokey stuff. Deinstalled and reinstalled VS Code and all versions of SharePointPnPPowerShellOnline. Still had the problem, again, only in VS Code. 

Switched in VS Code from the PowerShell Integrated Console to just powershell, imported successfully, came back to the integrated command console and everything now seems fine (I'm scared to give the "all good" yet ...).  Bizarre. Felt like I was doing the dance of 100 troubleshooting ideas and now I WISH I knew exactly what pieces fixed it in case it might help someone else, but, sigh, I don't know for sure.