Forum Discussion
NotAlex
Jan 29, 2020Iron Contributor
PNP Apply Template CSOM files not found
Hi All
I need to be able to apply pnp templates in CSOM with branding files exported from a site, please see below for details.
I am doing the following
- Getting Template and branding files using powershell with: Get-PnPProvisioningTemplate -out "testtemplate.xml" -PersistBrandingFiles
- Uploading the xml and site assets folder to a document library in SharePoint
- Using XMLSharePointTemplateProvider in CSOM C# to get the template from SharePoint
- Applying the template to a site using Web.ApplyProvisioningTemplate C# CSOM (Issue)
My issue is on step 4 applying the template, the template cannot work out where the /siteassets folder is to retrieve the files it needs to upload, so I am getting a FileNotFound error.
It works fine if i do not use the "-persistBrandingFiles" getting the template, however we need to get the files for other reasons.
As far as I am aware there is no way to apply a .pnp template file in CSOM C# as all the examples only use xml.
Any help would be appreciated.
Thanks
Alex
- mahendra2021Copper Contributor
did you get any lead on this issue? NotAlex
- NotAlexIron Contributor
mahendra2021 no I did not