Forum Discussion
PnP Provisioning Framework - Referenced content type not available in site or template
It is not a Developer Tenant. Not sure where this contenttype originates from, and as I wrote it only appears in non-english templates.
For now I have solved it by having code like the following, running on the loaded template when provisioning on-prem:
ContentTypeBinding bindingToLookFor = new ContentTypeBinding(); bindingToLookFor.ContentTypeId = "0x0101009D1CB255DA76424F860D91F20E6C4118"; var offendingLists = template.Lists.Where(l => l.ContentTypeBindings.Contains(bindingToLookFor)); foreach (var l in offendingLists) { l.ContentTypeBindings.Remove(bindingToLookFor); }
- Malathi SekkappanMar 17, 2017Copper Contributor
I am using US English, and I am getting the same error while using the team site, I am using the latest PnP ver 2.13.1703. Sometimes, it works though. Any ideas?
- Luis MañezMar 20, 2017MVPInteresting. Now there's much more information about that Content Type. This CT is the one used in Modern Sites, to specify Modern Pages:
https://msdn.microsoft.com/en-us/pnp_articles/modern-experience-customizations-customize-pages
The only thing that I can think, is that if you Export the template from a Modern Site, and apply it to a non-modern site, you could get that issue, as the CT could be not present in a non-modern site.
Can you elaborate the case when it works?
Thanks.- Malathi SekkappanMar 20, 2017Copper Contributor
I tried to filter out the content type, but it does not get inside the for loop of the template I am using so these do not exist in my template. But, I still got the error. I generated a new template out of a vanilla site online and I was able to provision that template. I had some objects that were generated from on-prem, I wonder whether that is causing the error.