none
Why won't my add-in validate? RRS feed

  • Question

  • I've been working on a word add-in, and I'm trying to get it up and running, but I'm getting some XML Schema violations that I need to fix first. I've tried posting this on stackoverflow, answers.microsoft.com, and even live customer support but everyone seems to think my manifest file is fine and don't know what's causing the problem

    I've noticed that links to schemas.microsoft.com don't seem to work when I try to access it with a browser, but I'm not sure if it's actually related (I had a user on answers.microsoft tell me that the link has never worked in browsers, so maybe it's unrelated)

    Here's the errors I'm getting when I try to run validate-office-addin:

    Calling validation service. This might take a moment... ------------------------------------- Validation: Failed Error #1: XML Schema Violation: Your manifest does not adhere to the current set of XML schema definitions for Office Add-in manifests. (link: https://aka.ms/add-in-manifest-schema-violation) - Details: The element 'Icon' in namespace 'http://schemas.microsoft.com/office/taskpaneappversionoverrides' has invalid child element 'Image' in namespace 'https://schemas.microsoft.com/office/officeappbasictypes/1.0'. List of possible elements expected: 'Image' in namespace 'http://schemas.microsoft.com/office/officeappbasictypes/1.0'. - Line: 87 - Column: 20 Error #2: XML Schema Violation: Your manifest does not adhere to the current set of XML schema definitions for Office Add-in manifests. (link: https://aka.ms/add-in-manifest-schema-violation) - Details: The element 'Icon' in namespace 'http://schemas.microsoft.com/office/taskpaneappversionoverrides' has invalid child element 'Image' in namespace 'https://schemas.microsoft.com/office/officeappbasictypes/1.0'. List of possible elements expected: 'Image' in namespace 'http://schemas.microsoft.com/office/officeappbasictypes/1.0'. - Line: 102 - Column: 22 Error #3: XML Schema Violation: Your manifest does not adhere to the current set of XML schema definitions for Office Add-in manifests. (link: https://aka.ms/add-in-manifest-schema-violation) - Details: The element 'Resources' in namespace 'http://schemas.microsoft.com/office/taskpaneappversionoverrides' has invalid child element 'Images' in namespace 'https://schemas.microsoft.com/office/officeappbasictypes/1.0'. List of possible elements expected: 'Images, Urls, ShortStrings, LongStrings' in namespace 'http://schemas.microsoft.com/office/officeappbasictypes/1.0'. - Line: 123 - Column: 8 -------------------------------------

    I'm not sure why it's saying 'Image' is an invalid child element when it lists 'Image' as the only valid element?

    Here's the actual manifest file itself:
    <?xml version="1.0" encoding="UTF-8"?>
    <OfficeApp
        xmlns="http://schemas.microsoft.com/office/appforoffice/1.1"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:bt="https://schemas.microsoft.com/office/officeappbasictypes/1.0"
        xmlns:ov="https://schemas.microsoft.com/office/taskpaneappversionoverrides"
        xsi:type="TaskPaneApp">
    
    
      <!-- Begin Basic Settings: Add-in metadata, used for all versions of Office unless override provided. -->
    
      <!-- IMPORTANT! Id must be unique for your add-in, if you reuse this manifest ensure that you change this id to a new GUID. -->
      <Id>452435-24352345-23452345-141324</Id>
    
      <!--Version. Updates from the store only get triggered if there is a version change. -->
      <Version>0.9.0.0</Version>
      <ProviderName>Example Pty. Ltd.</ProviderName>
      <DefaultLocale>en-US</DefaultLocale>
      <!-- The display name of your add-in. Used on the store and various places of the Office UI such as the add-ins dialog. -->
      <DisplayName DefaultValue="Example App" />
      <Description DefaultValue="This is an example app"/>
    
      <!-- Icon for your add-in. Used on installation screens and the add-ins dialog. -->
      <IconUrl DefaultValue="https://example.com/assets/icon-32.png" />
      <HighResolutionIconUrl DefaultValue="https://example.com/assets/icon-80.png"/>
    
      <!--If you plan to submit this add-in to the Office Store, uncomment the SupportUrl element below-->
      <!--<SupportUrl DefaultValue="[Insert the URL of a page that provides support information for the app]">-->
    
      <!-- Domains that will be allowed when navigating. For example, if you use ShowTaskpane and then have an href link, navigation will only be allowed if the domain is on this list. -->
      <AppDomains>
        <AppDomain>AppDomain1</AppDomain>
        <AppDomain>AppDomain2</AppDomain>
        <AppDomain>AppDomain3</AppDomain>
      </AppDomains>
      <!--End Basic Settings. -->
    
      <!--Begin TaskPane Mode integration. This section is used if there are no VersionOverrides or if the Office client version does not support add-in commands. -->
      <Hosts>
        <Host Name="Document" />
      </Hosts>
      <DefaultSettings>
        <SourceLocation DefaultValue="https://example.com/index.html" />
      </DefaultSettings>
      <!-- End TaskPane Mode integration.  -->
    
      <Permissions>ReadWriteDocument</Permissions>
    
      <!-- Begin Add-in Commands Mode integration. -->
      <VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0">
        <!-- The Hosts node is required. -->
        <Hosts>
          <!-- Each host can have a different set of commands. -->
          <!-- Excel host is Workbook, Word host is Document, and PowerPoint host is Presentation. -->
          <!-- Make sure the hosts you override match the hosts declared in the top section of the manifest. -->
          <Host xsi:type="Document">
            <!-- Form factor. Currently only DesktopFormFactor is supported. -->
            <DesktopFormFactor>
              <!--"This code enables a customizable message to be displayed when the add-in is loaded successfully upon individual install."-->
              <GetStarted>
                <!-- Title of the Getting Started callout. resid points to a ShortString resource -->
                <Title resid="Contoso.GetStarted.Title"/>
    
                <!-- Description of the Getting Started callout. resid points to a LongString resource -->
                <Description resid="Contoso.GetStarted.Description"/>
    
                <!-- Point to a url resource which details how the add-in should be used. -->
                <LearnMoreUrl resid="Contoso.GetStarted.LearnMoreUrl"/>
              </GetStarted>
              <!-- Function file is a HTML page that includes the JavaScript where functions for ExecuteAction will be called.
                Think of the FunctionFile as the code behind ExecuteFunction. -->
              <FunctionFile resid="Contoso.DesktopFunctionFile.Url" />
    
              <!-- PrimaryCommandSurface is the main Office Ribbon. -->
              <ExtensionPoint xsi:type="PrimaryCommandSurface">
                <!-- Use OfficeTab to extend an existing Tab. Use CustomTab to create a new tab. -->
                <OfficeTab id="TabHome">
                  <!-- Ensure you provide a unique id for the group. Recommendation for any IDs is to namespace using your company name. -->
                  <Group id="Contoso.Group1">
                    <!-- Label for your group. resid must point to a ShortString resource. -->
                    <Label resid="Contoso.Group1Label" />
                    <!-- Icons. Required sizes 16,32,80, optional 20, 24, 40, 48, 64. Strongly recommended to provide all sizes for great UX. -->
                    <!-- Use PNG icons. All URLs on the resources section must use HTTPS. -->
                    <Icon>
                      <bt:Image size="16" resid="Contoso.tpicon_16x16" />
                      <bt:Image size="32" resid="Contoso.tpicon_32x32" />
                      <bt:Image size="80" resid="Contoso.tpicon_80x80" />
                    </Icon>
    
                    <!-- Control. It can be of type "Button" or "Menu". -->
                    <Control xsi:type="Button" id="Contoso.TaskpaneButton">
                      <Label resid="Contoso.TaskpaneButton.Label" />
                      <Supertip>
                        <!-- ToolTip title. resid must point to a ShortString resource. -->
                        <Title resid="Contoso.TaskpaneButton.Label" />
                        <!-- ToolTip description. resid must point to a LongString resource. -->
                        <Description resid="Contoso.TaskpaneButton.Tooltip" />
                      </Supertip>
                      <Icon>
                        <bt:Image size="16" resid="Contoso.tpicon_16x16" />
                        <bt:Image size="32" resid="Contoso.tpicon_32x32" />
                        <bt:Image size="80" resid="Contoso.tpicon_80x80" />
                      </Icon>
    
                      <!-- This is what happens when the command is triggered (E.g. click on the Ribbon). Supported actions are ExecuteFunction or ShowTaskpane. -->
                      <Action xsi:type="ShowTaskpane">
                        <TaskpaneId>ButtonId1</TaskpaneId>
                        <!-- Provide a url resource id for the location that will be displayed on the task pane. -->
                        <SourceLocation resid="Contoso.Taskpane.Url" />
                      </Action>
                    </Control>
                  </Group>
                </OfficeTab>
              </ExtensionPoint>
            </DesktopFormFactor>
          </Host>
        </Hosts>
    
        <!-- You can use resources across hosts and form factors. -->
        <Resources>
          <bt:Images>
            <bt:Image id="Contoso.tpicon_16x16" DefaultValue="https://example.com/assets/icon-16.png" />
            <bt:Image id="Contoso.tpicon_32x32" DefaultValue="https://example.com/assets/icon-32.png" />
            <bt:Image id="Contoso.tpicon_80x80" DefaultValue="https://example.com/assets/icon-80.png" />
          </bt:Images>
          <bt:Urls>
            <bt:Url id="Contoso.Taskpane.Url" DefaultValue="https://example.com/index.html" />
            <bt:Url id="Contoso.GetStarted.LearnMoreUrl" DefaultValue="https://go.microsoft.com/fwlink/?LinkId=276812" />
            <bt:Url id="Contoso.DesktopFunctionFile.Url" DefaultValue="https://example.com/function-file/function-file.html" />
          </bt:Urls>
          <!-- ShortStrings max characters==125. -->
          <bt:ShortStrings>
            <bt:String id="Contoso.TaskpaneButton.Label" DefaultValue="Show Taskpane" />
            <bt:String id="Contoso.Group1Label" DefaultValue="Commands Group" />
            <bt:String id="Contoso.GetStarted.Title" DefaultValue="Get started with your sample add-in!" />
          </bt:ShortStrings>
          <!-- LongStrings max characters==250. -->
          <bt:LongStrings>
            <bt:String id="Contoso.TaskpaneButton.Tooltip" DefaultValue="Click to Show a Taskpane" />
            <bt:String id="Contoso.GetStarted.Description" DefaultValue="Your sample add-in loaded succesfully. Go to the HOME tab and click the 'Show Taskpane' button to get started." />
          </bt:LongStrings>
        </Resources>
      </VersionOverrides>
      <!-- End Add-in Commands Mode integration. -->
    
    </OfficeApp>

    Any help would be much appreciated, I've been scratching my head over this for a while now!

    Tuesday, December 11, 2018 12:16 AM

All replies

  • 1. I haven't checked, but I think in your namespace defintions at he top of the XML document you need 

        xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0"
    

    rather than

        xmlns:bt="https://schemas.microsoft.com/office/officeappbasictypes/1.0"
    

    (i.e "http" not "https"). You might need to check the other namespace names as well.

    2. The thing is that the Namespace names are just names. They do not have to point to the actual schema in any way. They often look like web addresses because it's a way of preventing naming clashes and indicating ownership or origon of .a particular namespace. But a namespace name could be just "timbuktu" or "fred". The fact that a namespace name looks like an http or https URL does not mean that you will necessarily find the relevant schema at that address, although you might do so. So anything that wants to validate a particular schema basically has to have a copy of that schema. (There are mechanisms in XML to point to a schema location but you cannot assume that such mechanisms will actually be honoured by the parser).




    Peter Jamieson

    Tuesday, December 11, 2018 1:11 AM
  • That solved it, thanks for the help!
    Tuesday, December 11, 2018 2:01 AM
  • Hi Thorium92,

     

    Thanks for your asking. Please remember to mark the replies as answers if they helped and please help us close the thread.

     

    Thank you for understanding. If you have any question, or update, please feel free to let us know.

     

    I wish you a happy life!

     

    Best Regards,

     

    Lina


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread.

    Tuesday, December 11, 2018 2:07 AM