Oct 29 2016 02:20 AM - edited Oct 29 2016 02:53 AM
Hi,
I extracted a .pnp template from a sub site (publishing) and then tried to apply that .pnp template to a newly created sub site (publishing) but I could not do this,
when I try to apply from power shell or C# console application it shows this error
I tried by downloading the pnp core source code and found that file stream is missing there, how can I solve this issue? Please help.
Here is a screenshot of powershell window
Oct 30 2016 09:43 AM
Oct 30 2016 10:01 PM
Oct 30 2016 11:28 PM
It is strange. It looks like the path does not exist. Did you check the template with the loaded schema if not working?
Oct 30 2016 11:34 PM
@Deleted I checked it is loaded when I tried to apply it from debug mode. It applies list instances and when it tries to apply Files (default.aspx) it fails
Oct 30 2016 11:45 PM
Ok that is another question. did you try to rename the default.aspx just to try it and remove the webparts..
Oct 31 2016 12:08 AM
@Deleted I did not rename anything.
Please see the following screen shots what I did (all using power shell)
Extracted template from site
Applying template started
Applying template fails
I am attaching the .xml template file
Thanks
Oct 31 2016 03:38 AM
Hi,
looked at your template and what i would do narrow it down meaning remove parts of the xml like what happeens if all is commented out except time... etc..
furthermore i see this line:
<pnp:Property Key="PublishingPageLayout" Value="{sitecollection}/_catalogs/masterpage/wizdom2Column.aspx, https://xxxx.sharepoint.com/sites/rayhan{sitecollection}/_catalogs/masterpage/wizdom2Column.aspx" />
Wher you use a url and a sitecolleciton token in 1 url...
Oct 31 2016 04:33 AM
Oct 31 2016 05:55 AM - edited Oct 31 2016 05:56 AM
SolutionHi,
it seems the pages are not in the current directory. My pnp:files look like this
<pnp:File src="SiteAssets\Logo.png" Folder="SiteAssets" Overwrite="true" />
where src could be C:\temp\sitesassets\logo.png
so whitout properties
but also do you need to provision the masterpages? If they are already in there why would you like to upload your version?
hope it helps.
Oct 31 2016 06:59 AM
Hi @Jess Lassen,
The easiest way to debug this is using PowerShell Set-SPOTraceLog.
https://veenstra.me.uk/2016/07/29/office-365-sharepoint-how-to-debug-pnp-provisioning-engine/
Oct 31 2016 09:46 PM
Oct 31 2016 11:57 PM
@Deleted one thing, I told you it works, but it only works from PowerShell but not from C# console application, can you give any clue? By the way, this time I am using .pnp template.
Thanks
Nov 01 2016 02:13 AM
Hi Jess,
please make sure youre files are in the correct directory aka the bin directory where your console is running.
kr,
Paul
Oct 31 2016 05:55 AM - edited Oct 31 2016 05:56 AM
SolutionHi,
it seems the pages are not in the current directory. My pnp:files look like this
<pnp:File src="SiteAssets\Logo.png" Folder="SiteAssets" Overwrite="true" />
where src could be C:\temp\sitesassets\logo.png
so whitout properties
but also do you need to provision the masterpages? If they are already in there why would you like to upload your version?
hope it helps.