Forum Discussion

Visweswararao Putchala's avatar
Visweswararao Putchala
Copper Contributor
Nov 15, 2016

Value cannot be null. Parameter name: stream Issue

Hi, I have installed the PnP Partner Pack V2 and all are working as expected. In the PnPProvisioningTemplates library, i have uploaded a xml file and created new folder having css, images, fonts, js, PageLayouts and ThemeGallaery. I can select my new template in the Azure web app (http://webappdev.azurewebsites.net/Home/CreateSiteCollection). During the site creation it is able to apply the template (having web settings, regional seetings, security, features, custom actions) except files (throwing an error: "Value cannot be null. Parameter name: stream"). File details in the XML as below: 

<pnp:File src=".\Style Library\Images\banner.png" Folder="{site}/Style Library/Images" Overwrite="true">
</pnp:File>

Soruce location :  https://tenant.sharepoint.com/sites/sitename/PnPProvisioningTemplates/CustomTemplate/Style%20Library/images/banner.png

Target location: 

{site}/Style Library/Images

 

Can someone suggest me, how to pass the source file Url, so that files can be picked up and uploaded into the target location using the XML template.

4 Replies

  • Are you using Powershell to do this or csom? and if i remember you need to specify the whole path if you use azure.

    and do you have a connector on the filessystem depending on where you put your files you have to apply the correct path says my colleague Robert Schouten

    • Visweswararao Putchala's avatar
      Visweswararao Putchala
      Copper Contributor

      Hi Paul,

       

      Thanks for the reply! 

      I have fixed the issue as below. My learnings are below:

      1. If i am reading the files from directory (local folder), my file srouce path is 

      <pnp:File src=".\CustomFolder\css\filename.css" Folder="{site}/Style Library/css" Overwrite="true">
      </pnp:File>

      2. If i am reading the files from different site collection, my file path is 

      <pnp:File src="/CustomFolder/filename.css" Folder="{site}/Style Library/css" Overwrite="true">
      </pnp:File>

      • Ravi Chandra's avatar
        Ravi Chandra
        Copper Contributor

        Hi, Quick question on the second point.

         

        2. If i am reading the files from different site collection, my file path is 

        <pnp:File src="/CustomFolder/filename.css" Folder="{site}/Style Library/css" Overwrite="true">

         

        How you specify the src path here? I mean how it knows, which site collection to read? I have the css in another site collection library and want to copy from there to destination site.

         

        Any hints?

         

        Thanks!
        Ravi