{"action":"opened","issue":{"url":"https://api.github.com/repos/SharePoint/PnP-Sites-Core/issues/1703","repository_url":"https://api.github.com/repos/SharePoint/PnP-Sites-Core","labels_url":"https://api.github.com/repos/SharePoint/PnP-Sites-Core/issues/1703/labels{/name}","comments_url":"https://api.github.com/repos/SharePoint/PnP-Sites-Core/issues/1703/comments","events_url":"https://api.github.com/repos/SharePoint/PnP-Sites-Core/issues/1703/events","html_url":"https://github.com/SharePoint/PnP-Sites-Core/issues/1703","id":310228471,"number":1703,"title":"The Provisioning Template URI Example.xml is not valid.","user":{"login":"huydq1903","id":37952909,"avatar_url":"https://avatars1.githubusercontent.com/u/37952909?v=4","gravatar_id":"","url":"https://api.github.com/users/huydq1903","html_url":"https://github.com/huydq1903","followers_url":"https://api.github.com/users/huydq1903/followers","following_url":"https://api.github.com/users/huydq1903/following{/other_user}","gists_url":"https://api.github.com/users/huydq1903/gists{/gist_id}","starred_url":"https://api.github.com/users/huydq1903/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/huydq1903/subscriptions","organizations_url":"https://api.github.com/users/huydq1903/orgs","repos_url":"https://api.github.com/users/huydq1903/repos","events_url":"https://api.github.com/users/huydq1903/events{/privacy}","received_events_url":"https://api.github.com/users/huydq1903/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-31T09:51:48Z","updated_at":"2018-03-31T09:51:48Z","closed_at":null,"author_association":"NONE","body":"I am heading to get the `ProvisioningTemplate` with `XMLSharePointTemplateProvider` from a uploaded file (xml file) in a Document Library. However, I got an issue with \"The Provisioning Template URI FileName.xml is not valid.\" Could you please help me solve this problem? or any suggestion is appreciated.\r\n\r\nHere is my codes:\r\n**Option 1:**\r\n```\r\nvar siteUrl = \"https://vdbvn.sp.local\";\r\nvar docList = \"DocTemplate\";\r\nvar fileName = \"PnP_PortfolioTemplate.xml\";\r\nvar ctx = new ClientContext(siteUrl);\r\nvar web = ctx.Web;\r\nctx.Load(web, w => w.Title);\r\nctx.ExecuteQuery();\r\nvar provider = new XMLSharePointTemplateProvider(ctx, siteUrl, docList);\r\nvar template = provider.GetTemplate(fileName); // Error when trying to get `GetTemplate` here\r\n```\r\n\r\n**Option 2:**\r\nvar web = ctx.Web;\r\nvar list = web.Lists.GetByTitle(fileTemplateName);\r\n\r\nvar query = new CamlQuery();\r\nquery.ViewXml =\r\n    @\"<View>\r\n        <Query>\r\n            <Where>\r\n                <Eq>\r\n                    <FieldRef Name='Title' />\r\n                    <Value Type='Text'>Example.xml</Value>\r\n                </Eq>\r\n            </Where>\r\n        </Query>\r\n        <ViewFields>\r\n            <FieldRef Name='Title' />\r\n        </ViewFields>\r\n    </View>\";\r\n\r\nvar items = list.GetItems(query);\r\nctx.Load(items, includes => includes.Include(i => i.File));\r\nctx.ExecuteQueryRetry();\r\nweb.EnsureProperty(w => w.Url);\r\n\r\nforeach (var item in items)\r\n{\r\n    var provider = new XMLSharePointTemplateProvider(ctx, web.Url, docList);\r\n    item.File.EnsureProperties(f => f.Name, f => f.ServerRelativeUrl);\r\n    var template = provider.GetTemplate(item.File.Name); // Error when trying to get `GetTemplate` here\r\n    Console.ReadLine();\r\n}"}}
{"actor":{"display_login":"huydq1903"}}