{"action":"created","issue":{"url":"https://api.github.com/repos/OfficeDev/PnP/issues/1555","repository_url":"https://api.github.com/repos/OfficeDev/PnP","labels_url":"https://api.github.com/repos/OfficeDev/PnP/issues/1555/labels{/name}","comments_url":"https://api.github.com/repos/OfficeDev/PnP/issues/1555/comments","events_url":"https://api.github.com/repos/OfficeDev/PnP/issues/1555/events","html_url":"https://github.com/OfficeDev/PnP/issues/1555","id":185649932,"number":1555,"title":"Cannot provision file (home.aspx) from template xml by CSOM ApplyTemplateProvisioning","user":{"login":"khha","id":9421415,"avatar_url":"https://avatars.githubusercontent.com/u/9421415?v=3","gravatar_id":"","url":"https://api.github.com/users/khha","html_url":"https://github.com/khha","followers_url":"https://api.github.com/users/khha/followers","following_url":"https://api.github.com/users/khha/following{/other_user}","gists_url":"https://api.github.com/users/khha/gists{/gist_id}","starred_url":"https://api.github.com/users/khha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khha/subscriptions","organizations_url":"https://api.github.com/users/khha/orgs","repos_url":"https://api.github.com/users/khha/repos","events_url":"https://api.github.com/users/khha/events{/privacy}","received_events_url":"https://api.github.com/users/khha/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-27T12:06:53Z","updated_at":"2016-11-01T15:13:59Z","closed_at":null,"body":"Thank you for reporting an issue or suggesting an enhancement. We appreciate your feedback - to help the team to understand your needs, please complete the below template to ensure we have the necessary details to assist you. If you have a actual question, we would ask you to use PnP Yammer group at http://aka.ms/OfficeDevPnPYammer. Thanks!\n#### Which PnP repository to report the issue?\n- PnP Sites Core - https://github.com/OfficeDev/PnP-Sites-Core\n\n_You can delete this section after you have confirmed target repository for your submission._\n#### Category\n\n[ ] Bug\n[ ] Enhancement\n#### Environment\n\n[ ] Office 365 / SharePoint Online\n[ ] SharePoint 2016\n[ V] SharePoint 2013\n\nI have an SharePoint App Part. In this app part I try to do ApplyTemplateProvisioning. I have an xml file where I try to provision a file. This file is in the same folder as the template xml file. I got this error:\n\n`Value cannot be null exception`\n\nThis is my template xml file:\n\n```\n<pnp:Files>\n        <pnp:File Src=\"Home.aspx\" Folder=\"{site}/Paginas\" Overwrite=\"true\">\n          <pnp:Properties>\n            <pnp:Property Key=\"ContentTypeId\" Value=\"{contenttypeid:Welkomstpagina}\" />\n            <pnp:Property Key=\"Title\" Value=\"Home\" />\n            <pnp:Property Key=\"PublishingPageLayout\" Value=\"{masterpagecatalog}{site}/BlankWebPartPage.aspx, Lege pagina met webonderdelen\" />\n            <pnp:Property Key=\"PublishingIsFurlPage\" Value=\"False\" />\n            <pnp:Property Key=\"RobotsNoIndex\" Value=\"False\" />\n            <pnp:Property Key=\"PublishingPageContent\" Value=\"&lt;h1&gt;​​Welkom op de Periode!&lt;{site}h1&gt;\" />\n          </pnp:Properties>\n        </pnp:File>\n      </pnp:Files>\n```\n\nThis is the CSOM code:\n\n```\nprivate bool ApplyProvisioningTemplate(Web newWeb)\n        {\n            XMLTemplateProvider provider = new XMLFileSystemTemplateProvider(String.Format(@\"{0}\\Templates\\\", AppDomain.CurrentDomain.BaseDirectory), \"\");\n\n            if (provider != null)\n            {\n                var template = provider.GetTemplate(\"PeriodeTemplate.xml\");\n\n                if (template != null)\n                {\n                    newWeb.ApplyProvisioningTemplate(template);\n\n                    return true;\n                }\n            }\n\n            return false;\n        }\n```\n\nWhat is going wrong? I try this with pnp powershell and is working fine. When I try this with CSOM pnp code it doesnt work.\n"},"comment":{"url":"https://api.github.com/repos/OfficeDev/PnP/issues/comments/257593083","html_url":"https://github.com/OfficeDev/PnP/issues/1555#issuecomment-257593083","issue_url":"https://api.github.com/repos/OfficeDev/PnP/issues/1555","id":257593083,"user":{"login":"erwinvanhunen","id":7666381,"avatar_url":"https://avatars.githubusercontent.com/u/7666381?v=3","gravatar_id":"","url":"https://api.github.com/users/erwinvanhunen","html_url":"https://github.com/erwinvanhunen","followers_url":"https://api.github.com/users/erwinvanhunen/followers","following_url":"https://api.github.com/users/erwinvanhunen/following{/other_user}","gists_url":"https://api.github.com/users/erwinvanhunen/gists{/gist_id}","starred_url":"https://api.github.com/users/erwinvanhunen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erwinvanhunen/subscriptions","organizations_url":"https://api.github.com/users/erwinvanhunen/orgs","repos_url":"https://api.github.com/users/erwinvanhunen/repos","events_url":"https://api.github.com/users/erwinvanhunen/events{/privacy}","received_events_url":"https://api.github.com/users/erwinvanhunen/received_events","type":"User","site_admin":false},"created_at":"2016-11-01T15:13:59Z","updated_at":"2016-11-01T15:13:59Z","body":"From a quick scan I notice that you do not set the connector on the template:\r\n\r\ntemplate.Connector = provider.Connector;\r\n\r\nThis will allow the engine to know where to retrieve any additional files you specify in the template."}}
{"actor":{"display_login":"erwinvanhunen"}}