0
votes

When using the PnP Powershell cmdlets to apply a provisioning template to a newly created Microsoft SharePoint site, I am getting this error:

"Apply-PnPProvisioningTemplate : Method not found 'System.String Microsoft.SharePoint.Client.WebParts.WebPartDefinition.get_ZoneId()'" 

STEPS OF WHAT I DID:

I generated a .xml provisioning template using a software I developed. Everything works fine with the PnP method, except when I try to provision the home page to add web parts from created lists. For the web part xml code, I extracted the provisioning template from a dummy website with the web part xml code in it, and used it in my software generally. Now when trying to provision to a new site, I get the mentioned error.

I tried uninstalling and reinstalling the 2013 PnP powershell Module, and looked a lot on for workarounds but information and help is way too sparse when it comes to PnP powershell cmdlets errors, on top of not working.

Also, I tried re-dowloading the provisioning template from the dummy website, using get-PnPProvisioningTemplate, and this time, I got the same mentionned error, rather than working fine.

here is the link to the xml template : https://codeshare.io/aYWYeN

in hope I was clear enough and that someone will be able to help me

1
Check what DLL hosts the class Microsoft.SharePoint.Client.WebParts.WebPartDefinition and check if there are older/newer versions of that DLL. Potentially, reinstall/update/use higher version of .NET framework (also, what .NET version and what OS version?)Vesper
I am using .NET framework 4.7 on windows 10raiskader
And from what I have seen, I think Microsoft.Sharepoint.Client.dll hosts trhe class, but I may still be wrongraiskader

1 Answers

2
votes

I realize I'm a little late to the party, however seeing as this is one of the top results (which are not closed) in the google search results maybe it will help someone who is still dealing with the issue.

This issue seems to keep appearing now and then (found some entries from 2017). There seems to be an issue in the newer assemblies.

Solution

1. Uninstall any other version of the package.
2. Install-Package SharePointPnPCore2013 -Version 3.5.1901

I only managed to make it work with 3.5.1901, any other version newer than this throws the error.

Latest version as of now is 3.10.1906