none
SharePoint Add-ins Deployment Error RRS feed

  • Question

  • Greetings Everyone !

    I am following a tutorial around here called

    Get started creating SharePoint-hosted SharePoint Add-ins"

     and of course before i get started following this tutorial i created a developer site, after i created the project and linked my developer site to the project while i am trying to compile i get "There were deployment errors" when i click yes i see this message:

    Severity	Code	Description	Project	File	Line	Suppression State
    Error		Error occurred in deployment step 'Install SharePoint Add-in': Feature definition with Id ee99ab8c-c37d-4df3-baa7-fe2d620d0136 failed validation, file 'EmployeeOrientation_NewEmployeeOrientationComponents\NewEmployeesInSeattle\Elements.xml', line 4, character 4: The element 'Elements' in namespace 'http://schemas.microsoft.com/sharepoint/' has invalid child element 'Data' in namespace 'http://schemas.microsoft.com/sharepoint/'. List of possible elements expected: 'ContentType, ContentTypeBinding, Field, CustomAction, Module, ListInstance, ListTemplate, Receivers, Workflow, WebTemplate, WorkflowAssociation, PropertyBag, ClientWebPart, BdcModel' in namespace 'http://schemas.microsoft.com/sharepoint/'.	EmployeeOrientation		0	


    I have edit NewEmployeeOrientationComponents.feature.xml a new option which is AlwaysForceInstall="TRUE". But still doesn't work and remain the same error. Is there any possible solution to fix this error ?

    PS: I am using Microsoft Visual Studio 2017

    Thank you !



    • Edited by SynthBZ Wednesday, September 4, 2019 12:15 PM
    Wednesday, September 4, 2019 12:07 PM

Answers

  • Hi,

    Make sure you add the instance data in correct place, here is demo xml.

    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
      <ListInstance Title="NewEmployeeOrientation"
                    OnQuickLaunch="TRUE"
                    TemplateType="100"
                    Url="Lists/NewEmployeeOrientation"
                    Description="My List Instance">
        <Data>
          <Rows>
            <Row>
              <Field Name="Title">Tom Higginbotham</Field>
            </Row>
            <Row>
              <Field Name="Title">Satomi Hayakawa</Field>
            </Row>
            <Row>
              <Field Name="Title">Cassi Hicks</Field>
            </Row>
            <Row>
              <Field Name="Title">Lertchai Treetawatchaiwong</Field>
            </Row>
          </Rows>
        </Data>
      </ListInstance>  
    </Elements>
    

    Best Regards,

    Lee


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    • Marked as answer by SynthBZ Friday, September 6, 2019 9:22 AM
    Thursday, September 5, 2019 2:50 AM

All replies

  • It seems that the Elements.xml file is not valid due to 
     invalid child element 'Data' 

    Justin Liu Office Apps & Services MVP, MCSE
    Senior Software Engineer
    Please Vote and Mark as Answer if it helps you.

    Thursday, September 5, 2019 1:02 AM
  • Hi,

    Make sure you add the instance data in correct place, here is demo xml.

    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
      <ListInstance Title="NewEmployeeOrientation"
                    OnQuickLaunch="TRUE"
                    TemplateType="100"
                    Url="Lists/NewEmployeeOrientation"
                    Description="My List Instance">
        <Data>
          <Rows>
            <Row>
              <Field Name="Title">Tom Higginbotham</Field>
            </Row>
            <Row>
              <Field Name="Title">Satomi Hayakawa</Field>
            </Row>
            <Row>
              <Field Name="Title">Cassi Hicks</Field>
            </Row>
            <Row>
              <Field Name="Title">Lertchai Treetawatchaiwong</Field>
            </Row>
          </Rows>
        </Data>
      </ListInstance>  
    </Elements>
    

    Best Regards,

    Lee


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    • Marked as answer by SynthBZ Friday, September 6, 2019 9:22 AM
    Thursday, September 5, 2019 2:50 AM
  • Thank you! That was my mistake i put data element outside the listinstance element.
    Friday, September 6, 2019 9:23 AM