Value cannot be null. Parameter name: stream Issue

%3CLINGO-SUB%20id%3D%22lingo-sub-30052%22%20slang%3D%22en-US%22%3EValue%20cannot%20be%20null.%20Parameter%20name%3A%20stream%20Issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-30052%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%20I%20have%20installed%20the%20PnP%20Partner%20Pack%20V2%20and%20all%20are%20working%20as%20expected.%20In%20the%20PnPProvisioningTemplates%20library%2C%20i%20have%20uploaded%20a%20xml%20file%20and%20created%20new%20folder%20having%20css%2C%20images%2C%20fonts%2C%20js%2C%20PageLayouts%20and%20ThemeGallaery.%20I%20can%20select%20my%20new%20template%20in%20the%20Azure%20web%20app%20(%3CA%20href%3D%22http%3A%2F%2Fwebappdev.azurewebsites.net%2FHome%2FCreateSiteCollection%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Fwebappdev.azurewebsites.net%2FHome%2FCreateSiteCollection%3C%2FA%3E).%20During%20the%20site%20creation%20it%20is%20able%20to%20apply%20the%20template%20(having%20web%20settings%2C%20regional%20seetings%2C%20security%2C%20features%2C%20custom%20actions)%26nbsp%3Bexcept%20files%20(throwing%20an%20error%3A%20%22%3CSPAN%3E%3CSTRONG%3EValue%20cannot%20be%20null.%20Parameter%20name%3A%20stream%3C%2FSTRONG%3E%22).%20File%20details%20in%20the%20XML%20as%20below%3A%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CFILE%20src%3D%22%26quot%3B.%5CStyle%22%20library%3D%22%22%3E%3CBR%20%2F%3E%3C%2FFILE%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3ESoruce%20location%20%3A%20%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftenant.sharepoint.com%2Fsites%2Fsitename%2FPnPProvisioningTemplates%2FCustomTemplate%2FStyle%2520Library%2Fimages%2Fbanner.png%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Ftenant.sharepoint.com%2Fsites%2Fsitename%2FPnPProvisioningTemplates%2FCustomTemplate%2FStyle%2520Library%2Fimages%2Fbanner.png%3C%2FA%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3ETarget%20location%3A%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%7Bsite%7D%2FStyle%20Library%2FImages%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3ECan%20someone%20suggest%20me%2C%20how%20to%20pass%20the%20source%20file%20Url%2C%20so%20that%20files%20can%20be%20picked%20up%20and%20uploaded%20into%20the%20target%20location%20using%20the%20XML%20template.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-278928%22%20slang%3D%22en-US%22%3ERe%3A%20RE%3A%20Value%20cannot%20be%20null.%20Parameter%20name%3A%20stream%20Issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-278928%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%20Quick%20question%20on%20the%20second%20point.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E2.%20If%20i%20am%20reading%20the%20files%20from%20different%20site%20collection%2C%20my%20file%20path%20is%26nbsp%3B%3C%2FP%3E%3CP%3E%3CFILE%20src%3D%22%26quot%3B%2F%26lt%3BSPAN%22%3ECustomFolder%2Ffilename.css%22%20Folder%3D%22%7Bsite%7D%2FStyle%20Library%2Fcss%22%20Overwrite%3D%22true%22%26gt%3B%3C%2FFILE%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHow%20you%20specify%20the%20src%26nbsp%3Bpath%20here%3F%20I%20mean%20how%20it%20knows%2C%20which%20site%20collection%20to%20read%3F%20I%20have%20the%20css%20in%20another%20site%20collection%20library%20and%20want%20to%20copy%20from%20there%20to%20destination%20site.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20hints%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks!%3CBR%20%2F%3ERavi%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-30357%22%20slang%3D%22en-US%22%3ERe%3A%20RE%3A%20Value%20cannot%20be%20null.%20Parameter%20name%3A%20stream%20Issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-30357%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Paul%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20for%20the%20reply!%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20fixed%20the%20issue%20as%20below.%20My%20learnings%20are%20below%3A%3C%2FP%3E%3CP%3E1.%20If%20i%20am%20reading%20the%20files%20from%20directory%20(local%20folder)%2C%20my%20file%20srouce%20path%20is%26nbsp%3B%3C%2FP%3E%3CP%3E%3CFILE%20src%3D%22%26quot%3B.%5CCustomFolder%5Ccss%5Cfilename.css%26quot%3B%22%20folder%3D%22%26quot%3B%7Bsite%7D%2FStyle%22%20library%3D%22%22%3E%3CBR%20%2F%3E%3C%2FFILE%3E%3C%2FP%3E%3CP%3E2.%20If%20i%20am%20reading%20the%20files%20from%20different%20site%20collection%2C%20my%20file%20path%20is%26nbsp%3B%3C%2FP%3E%3CP%3E%3CFILE%20src%3D%22%26quot%3B%2F%26lt%3BSPAN%22%3ECustomFolder%2Ffilename.css%22%20Folder%3D%22%7Bsite%7D%2FStyle%20Library%2Fcss%22%20Overwrite%3D%22true%22%26gt%3B%3CBR%20%2F%3E%3C%2FFILE%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-30087%22%20slang%3D%22en-US%22%3ERE%3A%20Value%20cannot%20be%20null.%20Parameter%20name%3A%20stream%20Issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-30087%22%20slang%3D%22en-US%22%3E%3CP%3EAre%20you%20using%20Powershell%20to%20do%20this%20or%20csom%3F%20and%20if%20i%20remember%20you%20need%20to%20specify%20the%20whole%20path%20if%20you%20use%20azure.%3C%2FP%3E%3CP%3Eand%20do%20you%20have%20a%20connector%20on%20the%20filessystem%20depending%20on%20where%20you%20put%20your%20files%20you%20have%20to%20apply%20the%20correct%20path%20says%20my%20%3CSPAN%3Ecolleague%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F18690%22%20target%3D%22_blank%22%3E%40Robert%20Schouten%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

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...

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.

3 Replies
Highlighted

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

Highlighted

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>

Highlighted

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