![]() |
SharePointPnPCore2013 Nuget package |
![]() |
Update Newtonsoft.Json package |
vti_encoding:SR|utf8-nl vti_extenderversion:SR|15.0.0.4841
it is SharePoint 2013, if you get:
vti_encoding:SR|utf8-nl vti_extenderversion:SR|16.0.0.4327
it is SharePoint 2016.
The code to pull a template and store it as an XML file is as simple as:
string fileName = "template.xml"; ProvisioningTemplateCreationInformation templateCreationInformation = new ProvisioningTemplateCreationInformation(web); var provisioningTemplate = web.GetProvisioningTemplate(templateCreationInformation); System.IO.File.WriteAllText( string.Format(@".\{0}", fileName), provisioningTemplate.ToXML() );
I have a full sample console application source if you want to see it all. I will get into some more interesting PnP code tomorrow, and talk about what the XML contains and how to build your own.
Keep coding!