-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Missing Method exception on Extracting Objects of Type ObjectListInstance #1121
Comments
In your source, check the ObjectListinstance.cs class in Framework\Provisioning\ObjectHandlers, on line 425 it should say: #if !CLIENTSDKV15 If not, you have an older version of the code somehow. Make sure that if you switch to the Debug15 configuration that those lines are greyed out. If not, visual studio is not applying the preprocessor variables. |
That seems okay, from a code perspective, it should not call the MajorWithMinorVersionsLimit method, as that one is not available on-premises. That's what the Debug15 (and Release15) configuration basically is for. So all good there. In your own built version, where do you install it? Do you have other versions of the PnP cmdlets installed and if so, which one is powershell using? In the installation folder of the cmdlets there should be a OfficeDevPnP.Core.dll. Did you replace that one with your compiled version? PowerShell will figure out which module to use by checking the folders as defined in the PSModulePath environment variable (check that one out through PowerShell with "$env:PSModulePath"). |
If the breakpoint is not resolving, it means that you're using a different assembly from the one you have open in Visual Studio. Did you check the value of your PSModulePath environment variable? Make sure there is only one folder in there which contains the actual PnP PowerShell assemblies. If you for instance installed the version from the MSI package first and -then- use the version which is compiled by visual studio you will end up with 2 entries in that variable: one pointing to c:\users\Documents\WindowsPowerShell\Modules\etc. Make sure that only c:\users\Documents\WindowsPowerShell\Modules\etc is in there as that is the version that the visual studio solution deploys. |
I have a bunch of module paths also used by other modules but the pnp dll's are just found here: Other variables: I also performed a deep search for that dll on my machine without finding other dll's... |
the properties are supported in On-Premises CSOM since the December 2014 CU: https://github.com/OfficeDev/PnP-Guidance/blob/master/articles/CSOM-Releases-And-New-Capabilities.md. We support with PnP the April 2015 CU and newer. |
Hi
I just downloaded the latest version compiled with Debug15 settings and tried to xml extract a SP Site (SP 2013 on-prem) using powershell:
Get-SPOProvisioningTemplate -Out c:\temp\template.xml
Unfortunately I always get an error message when the command tries to extract items of type ObjectListInstance.
After Debugging I get the Error in
...\Framework\Provisioning\ObjectHandlers\SiteToTemplateConversion.cs Line 74
Error text:
Get-SPOProvisioningTemplate : Methode nicht gefunden: "Int32 Microsoft.SharePoint.Client.List.get_MajorWithMinorVersionsLimit()".
In Zeile:1 Zeichen:1
StackTrace:
bei OfficeDevPnP.Core.Framework.Provisioning.ObjectHandlers.ObjectListInstance.ExtractObjects(Web web, ProvisioningTemplate template, ProvisioningTemplateCreationInformation creationInfo)
bei OfficeDevPnP.Core.Framework.Provisioning.ObjectHandlers.SiteToTemplateConversion.GetRemoteTemplate(Web web, ProvisioningTemplateCreationInformation creationInfo)
bei Microsoft.SharePoint.Client.WebExtensions.GetProvisioningTemplate(Web web, ProvisioningTemplateCreationInformation creationInfo)
bei OfficeDevPnP.PowerShell.Commands.Branding.GetProvisioningTemplate.GetProvisioningTemplateXML(XMLPnPSchemaVersion schema, String path)
bei OfficeDevPnP.PowerShell.Commands.Branding.GetProvisioningTemplate.ExecuteCmdlet()
bei OfficeDevPnP.PowerShell.Commands.SPOCmdlet.ProcessRecord()
Can anybody help?
Thanks
Roman
The text was updated successfully, but these errors were encountered: