Skip to content

ContentTypeBinding is not accepted as a child of elements #10005

Closed

Description

@ishaisagi-hns

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

💥 SharePoint Framework

Developer environment

Windows

What browser(s) / client(s) have you tested

  • 💥 Internet Explorer
  • 💥 Microsoft Edge
  • 💥 Google Chrome
  • 💥 FireFox
  • 💥 Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)

Additional environment details

sharepoint online
spfx 1.19.0

Describe the bug / error

this page
https://learn.microsoft.com/en-us/sharepoint/dev/schema/content-type-bindings
specifies the scheme for content type bindings.
however, when I use the sample provided and upload a package to SharePoint online (o365) I get the error

There were problems with the app web definition in the package.Details: Deployment failed in host web https://hideandseekdigital.sharepoint.com/sites/AFP-Integration for app AFP Intranet App Customiser/1bd5c67d-11c2-4372-8c72-9569b23ecb5e. Microsoft.SharePoint.SPException: Feature definition with Id 4036bacc-c5f3-4741-9f4f-af533d3678ae failed validation, file '/4036bacc-c5f3-4741-9f4f-af533d3678ae/AppSettingsLists.xml', line 11, character 6: The element 'Elements' in namespace 'http://schemas.microsoft.com/sharepoint/' has invalid child element 'ContentTypeBinding' in namespace 'http://schemas.microsoft.com/sharepoint/'. List of possible elements expected: 'CustomAction, ClientWebPart, ClientSideComponent, ClientSideComponentInstance, Field, ContentType, ListInstance, Module, PropertyBag' in namespace 'http://schemas.microsoft.com/sharepoint/'. at Microsoft.SharePoint.Administration.SPSolutionPackage.FeatureXmlValidationCallback.XmlValidationCallBack(Object sender, ValidationEventArgs evtargs) at System.Xml.Schema.XmlSchemaValidator.ValidateElementContext(XmlQualifiedName elementName, Boolean& invalidElementInContext) at System.Xml.Schema.XmlSchemaValidator.ValidateElement(String localName, String namespaceUri, XmlSchemaInfo schemaInfo, String xsiType, String xsiNil, String xsiSchemaLocation, String xsiNoNamespaceSchemaLocation) at System.Xml.XsdValidatingReader.ProcessElementEvent() at System.Xml.XsdValidatingReader.Read() at System.Xml.XmlReader.MoveToContent() at System.Xml.XmlReader.IsStartElement() at Microsoft.SharePoint.Utilities.SPUtility.XsdValidateXml(XmlTextReader xmlStreamReader, String friendlyName, String pathXsdFile, String tagExpectedRootNode, Int32 desiredPathVersion, ValidationEventHandler xsdValEventHandler) at Microsoft.SharePoint.Packaging.SPTargetWebDeploymentGroup.ValidateAppPartFeatureXsd(PackagePart appPart, Guid featureGuid) at Microsoft.SharePoint.Packaging.SPTargetWebDeploymentGroup.ExtractElementPartToWsp(PackagePart elementPart, TemporaryDirectory wspTempDir, SHA256Managed sha, Guid productId, SPAppInstance appInstance, Guid featureId, String featureWspRelativeDirectory) at Microsoft.SharePoint.Packaging.SPTargetWebDeploymentGroup.ExtractFeaturePartToWsp(SPFeatureAppPart featureAppPart, TemporaryDirectory wspTempDir, SHA256Managed sha, Guid productId, SPAppInstance appInstance) at Microsoft.SharePoint.Packaging.SPTargetWebDeploymentGroup.ExtractFeaturePartsToWsp(List1 featureAppParts, SPWeb web, TemporaryDirectory wspTempDir, SHA256Managed sha, Guid productId) at Microsoft.SharePoint.Packaging.SPTargetWebDeploymentGroup.GenerateAndActivateUserSolutionFromPackage(SPWeb web, SPAppPackage appPackage, Guid productId, String solutionName, SPSolutionLevel solutionLevel) at Microsoft.SharePoint.Packaging.SPTargetWebDeploymentGroup.InstallOrUpgrade(SPSite site, Nullable1& solutionId, Boolean& swapNeeded)

Steps to reproduce

  1. create a SPFX project (in my case an extension)
  2. add xml asset to bind a content type to a list. make sure the ContentTypeId is a valid one and the list exists in the specified listurl
  3. package and upload to site, try to add app to site

Expected behavior

Either

  1. the documentation is wrong and does not apply to sharepoint online anymore - in which case update it!
  2. there is a bug that sharepoint online does not recognise the schema it should

Activity

  1. added
    type:bug-suspectedSuspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.
    on Nov 7, 2024
  2. SethiaGit1988 commented on Dec 9, 2024

    @SethiaGit1988

    i am also facing same issue trying to bind the content type to existing list, using spfx assets deployment, however getting below error:
    here were problems with the app web definition in the package.

    Details: Deployment failed in host web https://*****.sharepoint.com/sites/**** for app /6a0b3439-fea6-406e-95d6-8ef52fc9e3f8. Microsoft.SharePoint.SPException: Feature definition with Id 3010bfbc-08c1-450c-a97e-f9802320feae failed validation, file '/3010bfbc-08c1-450c-a97e-f9802320feae/flatfields-elements.xml', line 177, character 10: The element 'ListInstance' in namespace 'http://schemas.microsoft.com/sharepoint/' has invalid child element 'ContentTypeBindings' in namespace 'http://schemas.microsoft.com/sharepoint/'. List of possible elements expected: 'Data, DataSource' in namespace 'http://schemas.microsoft.com/sharepoint/'. at Microsoft.SharePoint.Administration.SPSolutionPackage.FeatureXmlValidationCallback.XmlValidationCallBack(Object sender, ValidationEventArgs evtargs) at System.Xml.Schema.XmlSchemaValidator.ValidateElementContext(XmlQualifiedName elementName, Boolean& invalidElementInContext) at System.Xml.Schema.XmlSchemaValidator.ValidateElement(String localName, String namespaceUri, XmlSchemaInfo schemaInfo, String xsiType, String xsiNil, String xsiSchemaLocation, String xsiNoNamespaceSchemaLocation) at System.Xml.XsdValidatingReader.ProcessElementEvent() at System.Xml.XsdValidatingReader.Read() at System.Xml.XmlReader.MoveToContent() at System.Xml.XmlReader.IsStartElement() at Microsoft.SharePoint.Utilities.SPUtility.XsdValidateXml(XmlTextReader xmlStreamReader, String friendlyName, String pathXsdFile, String tagExpectedRootNode, Int32 desiredPathVersion, ValidationEventHandler xsdValEventHandler) at Microsoft.SharePoint.Packaging.SPTargetWebDeploymentGroup.ValidateAppPartFeatureXsd(PackagePart appPart, Guid featureGuid) at Microsoft.SharePoint.Packaging.SPTargetWebDeploymentGroup.ExtractElementPartToWsp(PackagePart elementPart, TemporaryDirectory wspTempDir, SHA256Managed sha, Guid productId, SPAppInstance appInstance, Guid featureId, String featureWspRelativeDirectory) at Microsoft.SharePoint.Packaging.SPTargetWebDeploymentGroup.ExtractFeaturePartToWsp(SPFeatureAppPart featureAppPart, TemporaryDirectory wspTempDir, SHA256Managed sha, Guid productId, SPAppInstance appInstance) at Microsoft.SharePoint.Packaging.SPTargetWebDeploymentGroup.ExtractFeaturePartsToWsp(List1 featureAppParts, SPWeb web, TemporaryDirectory wspTempDir, SHA256Managed sha, Guid productId) at Microsoft.SharePoint.Packaging.SPTargetWebDeploymentGroup.GenerateAndActivateUserSolutionFromPackage(SPWeb web, SPAppPackage appPackage, Guid productId, String solutionName, SPSolutionLevel solutionLevel) at Microsoft.SharePoint.Packaging.SPTargetWebDeploymentGroup.InstallOrUpgrade(SPSite site, Nullable1& solutionId, Boolean& swapNeeded)

  3. Ashlesha-MSFT commented on Apr 18, 2025

    @Ashlesha-MSFT
    Contributor

    Hello ishaisagi-hns,
    Thank you for bringing this issue to our attention. We will look into it and get back to you shortly.

  4. Ashlesha-MSFT commented on Apr 18, 2025

    @Ashlesha-MSFT
    Contributor

    ishaisagi-hns,
    We could not encountered error like above, can you please confirm which extension are you using?

  5. added
    Needs: Author FeedbackAwaiting response from the original poster of the issue. Marked as stale if no activity for 7 days.
    on Apr 18, 2025
  6. ishaisagi-hns commented on Apr 27, 2025

    @ishaisagi-hns
    Author

    By extension I mean the type of project (app customiser = extension).
    So create an app customiser project and add the xml as per documentation.

  7. removed
    Needs: Author FeedbackAwaiting response from the original poster of the issue. Marked as stale if no activity for 7 days.
    on Jul 11, 2025
  8. Ashlesha-MSFT commented on Aug 14, 2025

    @Ashlesha-MSFT
    Contributor

    ishaisagi-hns, Chetan Sethia (@SethiaGit1988),
    Apologies to delayed responce!
    I have followed the correct steps to reproduce the issue, but I was not able to see any error like the one you described. Could you please share your SPFx solution or provide more details about your setup where you are encountering this error? This will help us investigate further and provide more targeted assistance.

    Thank you!

  9. added
    Needs: Author FeedbackAwaiting response from the original poster of the issue. Marked as stale if no activity for 7 days.
    on Aug 14, 2025
  10. VesaJuvonen commented on Nov 3, 2026

    @VesaJuvonen
    Contributor

    This issue is more than 12 months old and has not had recent activity. We are cleaning up the backlog so we can manage incoming reports more efficiently. If the issue is still relevant, please submit a new issue with updated details and current reproduction steps. We apologize for any inconvenience caused by this updated process, and thank you for being part of the SharePoint developer ecosystem.

  11. github-actions commented on Nov 3, 2026

    @github-actions

    Thank you for taking the time to file an issue. We periodically archive older or inactive issues as part of our issue management process, which automatically closes them once they are archived.

    If you’d like to understand more about why and how we handle archived (closed) issues, please see Our approach to closed issues.

    We appreciate your contribution and if this is still an active issue with the latest SPFx versions, please do resubmit the details. We needed to perform a cleanup, so that we can start with a clean table with a new process. We apologize for the inconvenience this might cause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Needs: Author FeedbackAwaiting response from the original poster of the issue. Marked as stale if no activity for 7 days.Needs: Triage 🔍Awaiting categorization and initial review.sharepoint-developer-supportsharepoint-developer-supporttype:archive-old-issueIssues which are closed as tool old for active worktype:bug-suspectedSuspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions