Skip to content

ContentTypeBinding is not accepted as a child of elements #10005

@ishaisagi-hns

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

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: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