Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ContentTypeBinding is not accepted as a child of elements #10005

Open
1 of 9 tasks
ishaisagi-hns opened this issue Nov 7, 2024 · 0 comments
Open
1 of 9 tasks

ContentTypeBinding is not accepted as a child of elements #10005

ishaisagi-hns opened this issue Nov 7, 2024 · 0 comments
Labels
Needs: Triage 🔍 Awaiting categorization and initial review. type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.

Comments

@ishaisagi-hns
Copy link

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
@ishaisagi-hns ishaisagi-hns added the type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs. label Nov 7, 2024
@VesaJuvonen VesaJuvonen added the Needs: Triage 🔍 Awaiting categorization and initial review. label Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Triage 🔍 Awaiting categorization and initial review. type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.
Projects
None yet
Development

No branches or pull requests

2 participants