pnp / PnP-Sites-Core

Microsoft 365 Dev PnP Core component (.NET) targeted for increasing developer productivity with CSOM based solutions.
Other
416 stars 643 forks source link

Simple template fails - Invalid Template #1615

Open NPrice99 opened 6 years ago

NPrice99 commented 6 years ago

Which PnP repository should you use to report the issue?

Please navigate to the appropriate repository by clicking on the link below and create your issue there. You can delete this section after you have navigated to the correct repository.

Category

[ X] Bug [ ] Enhancement

Environment

[X ] Office 365 / SharePoint Online [ ] SharePoint 2016 [ ] SharePoint 2013

Expected or Desired Behavior

Simple Template should work :-

<?xml version="1.0"?>

#### Observed Behavior PS C:\\documents\PowerShell Scripts\SharePointOnline\Tenant Migration> Apply-pnpprovisioningtemplate -Path "C:\\Documents\PowerShell Scripts\SharePointOnline\Tenant Migration\Templates\ChequesList.xml " powershell.exe Information: 0 : 2018-02-25 11:08:24.1281 [OfficeDevPnP.Core] [0] [Information] File ChequesList.xml retrieved from folder 0ms powershell.exe Information: 0 : 2018-02-25 11:08:24.1281 [OfficeDevPnP.Core] [0] [Information] File ChequesList.xml retrieved from folder 0ms Apply-pnpprovisioningtemplate : The provided template is not valid! At line:1 char:1 + Apply-pnpprovisioningtemplate -Path "C:\Users\price\OneDrive\Document ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : WriteError: (:) [Apply-PnPProvisioningTemplate], ApplicationException + FullyQualifiedErrorId : EXCEPTION,SharePointPnP.PowerShell.Commands.Provisioning.ApplyProvisioningTemplate PS C:\documents\PowerShell Scripts\SharePointOnline\Tenant Migration> $error[0].Exception.ToString( ) System.ApplicationException: The provided template is not valid! at OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.XmlPnPSchemaBaseSerializer`1.ProcessInputStream(Stream template, String identifier, ProvisioningTemplate result) at OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.XmlPnPSchemaBaseSerializer`1.ToProvisioningTemplate(Stream template, String identifier) at OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.XMLPnPSchemaFormatter.ToProvisioningTemplate(Stream template, String identifier) at OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.XMLTemplateProvider.GetTemplate(String uri, String identifier, ITemplateFormatter formatter, ITemplateProviderExtension[] extensions) at OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.XMLTemplateProvider.GetTemplate(String uri, ITemplateProviderExtension[] extensions) at SharePointPnP.PowerShell.Commands.Provisioning.ApplyProvisioningTemplate.ExecuteCmdlet() at SharePointPnP.PowerShell.Commands.PnPCmdlet.ProcessRecord() PS C:\documents\PowerShell Scripts\SharePointOnline\Tenant Migration> $error[0].Exception.InnerExce ption.ToString() You cannot call a method on a null-valued expression. At line:1 char:1 + $error[0].Exception.InnerException.ToString() + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull This only occurs when I add
rgylesbedford commented 6 years ago

pnp:ListInstance needs to be inside a pnp:Lists element in order to be a valid template