pnp / pnp/pnpframework

GetProvisioningTemplate throws 'Stream is not a valid resource file' if 'PersistMultiLanguageResources' is set to true

Open
#892 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
259
Forks
161
Avg merge
10h 33m
Merged PRs (30d)
1

Description

While extracting PnP provisioning template from a SharePoint site, we are getting the error 'Stream is not a valid resource file' when ptci.PersistMultiLanguageResources = true. It works fine for all other parameters like PersistBrandingFiles, IncludeSiteGroups etc

image

Error details

System.ArgumentException
HResult=0x80070057
Message=Stream is not a valid resource file.
Source=mscorlib
StackTrace:
at System.Resources.ResourceReader._ReadResources()
at System.Resources.ResourceReader.ReadResources()
at System.Resources.ResourceReader..ctor(String fileName)
at PnP.Framework.Provisioning.ObjectHandlers.Extensions.UserResourceExtensions.SaveResourceValues(ProvisioningTemplate template, ProvisioningTemplateCreationInformation creationInfo)
at PnP.Framework.Provisioning.ObjectHandlers.ObjectLocalization.ExtractObjects(Web web, ProvisioningTemplate template, ProvisioningTemplateCreationInformation creationInfo)
at PnP.Framework.Provisioning.ObjectHandlers.SiteToTemplateConversion.GetRemoteTemplate(Web web, ProvisioningTemplateCreationInformation creationInfo)
at Microsoft.SharePoint.Client.WebExtensions.GetProvisioningTemplate(Web web, ProvisioningTemplateCreationInformation creationInfo)
at ConsoleAppPOC.Program.GetProvisioningTemplate(ConsoleColor defaultForeground, String webUrl, String clientId, String clientSecret) in C:\Users\AishwaryaManisekaran\source\repos\ConsoleAppPOC\Program.cs:line 85
at ConsoleAppPOC.Program.Main(String[] args) in C:\Users\AishwaryaManisekaran\source\repos\ConsoleAppPOC\Program.cs:line 110

Environment

.NETFramework, Version=v4.6.2
PnP.Framework, Version = v1.12.0

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at PnP.Framework.Provisioning.ObjectHandlers.Extensions.UserResourceExtensions.SaveResourceValues, following the extraction path through ObjectLocalization.ExtractObjects and SiteToTemplateConversion.GetRemoteTemplate. Reproduce the failure with PersistMultiLanguageResources set to true; done means template extraction completes without the invalid resource file exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.