Файл манифеста надстройки Office проходит «npm run validate», но завершается неудачно при боковой загрузке в Office Web - PullRequest
0 голосов
/ 27 апреля 2020

Я создаю командную кнопку на ленте задач, которая добавляет некоторые функциональные возможности для наших пользователей Office. Я начал использовать генератор yeoman , и надстройка прекрасно работает на локальном MS Excel, когда я запускаю npm start. Подтверждает, успешно работает npm run validate.

Но когда я пытаюсь загрузить манифест сбоку. xml в Excel для проверки (через Office Add-ins > Upload My Add-in), я пытаюсь загрузить манифест, и он немедленно возвращает сообщение:

Your add-in manifest is not valid.

Не очень полезное сообщение для устранения проблемы. Это моя первая надстройка, поэтому я не знаю, как поступить, любая помощь будет оценена. Манифест надстройки. xml ниже:

<?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="http://schemas.microsoft.com/office/officeappbasictypes/1.0" xmlns:ov="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="TaskPaneApp">

  <Id>bae311b6-a1be-4055-a0fc-c0371d95dc89</Id>
  <Version>1.0.0.0</Version>
  <ProviderName>Test</ProviderName>
  <DefaultLocale>en-US</DefaultLocale>
  <DisplayName DefaultValue="Add-in Commands Sample" />
  <Description DefaultValue="Sample that illustrates add-in commands basic control types and actions" />
  <IconUrl DefaultValue="https://i.imgur.com/oZFS95h.png" />
  <SupportUrl DefaultValue="https://www.sfchronicle.com/terms_of_use/" />

  <Hosts>
    <Host Name="Workbook"/>
  </Hosts>
  <DefaultSettings>
    <SourceLocation DefaultValue="https://commandsimple.azurewebsites.net/Taskpane.html" />
  </DefaultSettings>

  <Permissions>ReadWriteDocument</Permissions>

  <VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0">   
    <Hosts>
      <Host xsi:type="Workbook">
        <DesktopFormFactor>
          
          <GetStarted>
            <Title resid="Contoso.GetStarted.Title"/>
            
            <Description resid="Contoso.GetStarted.Description"/>
            
            <LearnMoreUrl resid="Contoso.GetStarted.LearnMoreUrl"/>
          </GetStarted>
          
          <FunctionFile resid="Contoso.FunctionFile.Url" />

          <ExtensionPoint xsi:type="PrimaryCommandSurface">
            <CustomTab id="Contoso.Tab1">
              <Group id="Contoso.Tab1.Group1">
                <Label resid="Contoso.Tab1.GroupLabel" />
                <Icon>
                  <bt:Image size="16" resid="Contoso.PublishButton.Icon" />
                  <bt:Image size="32" resid="Contoso.PublishButton.Icon" />
                  <bt:Image size="80" resid="Contoso.PublishButton.Icon" />
                </Icon>
                
                <Control xsi:type="Button" id="Contoso.FeedsButton">
                  <Label resid="Contoso.FeedsButton.Label" />
                  <Supertip>
                    <Title resid="Contoso.FeedsButton.Label" />
                    <Description resid="Contoso.FeedsButton.Tooltip" />
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="Contoso.FeedsButton.Icon" />
                    <bt:Image size="32" resid="Contoso.FeedsButton.Icon" />
                    <bt:Image size="80" resid="Contoso.FeedsButton.Icon" />
                  </Icon>

                  <Action xsi:type="ExecuteFunction">
                    <FunctionName>exportJSON</FunctionName>
                  </Action>
                </Control>
              </Group>

              <Label resid="Contoso.Tab1.TabLabel" />
            </CustomTab>
          </ExtensionPoint>
        </DesktopFormFactor>
      </Host>
    </Hosts>
    <Resources>
      <bt:Images>
        <bt:Image id="Contoso.PublishButton.Icon" DefaultValue="https://localhost:3000/assets/livepublish.png" />
        <bt:Image id="Contoso.FeedsButton.Icon" DefaultValue="https://localhost:3000/assets/livefeed.png" />
        <bt:Image id="Contoso.TestPubButton.Icon" DefaultValue="https://localhost:3000/assets/testpublish.png" />
        <bt:Image id="Contoso.TestFeedsButton.Icon" DefaultValue="https://localhost:3000/assets/testfeed.png" />
      </bt:Images>
      <bt:Urls>
        <bt:Url id="Contoso.FunctionFile.Url" DefaultValue="https://localhost:3000/fnfile.html" />
      </bt:Urls>
      <bt:ShortStrings>
        <bt:String id="Contoso.FeedsButton.Label" DefaultValue="Create Feed" />
        <bt:String id="Contoso.PublishButton.Label" DefaultValue="Publish Project" />
        <bt:String id="Contoso.TestFeedsButton.Label" DefaultValue="Create Test Feed" />
        <bt:String id="Contoso.TestPubButton.Label" DefaultValue="Publish Test Project" />
        <bt:String id="Contoso.Tab1.GroupLabel" DefaultValue="Publish Options" />
        <bt:String id="Contoso.Tab1.TabLabel" DefaultValue="Devhub Deploy" />
        <bt:String id="Contoso.GetStarted.LearnMoreUrl" DefaultValue="https://www.sfchronicle.com/terms_of_use/" />
        <bt:String id="Contoso.GetStarted.Title" DefaultValue="Deploy add-in was succesfully loaded">
          <bt:Override Locale="ja-jp" Value="Deploy Title" />
        </bt:String>      
      </bt:ShortStrings>
      <bt:LongStrings>
        <bt:String id="Contoso.FeedsButton.Tooltip" DefaultValue="Click to create a feed for a project" />
        <bt:String id="Contoso.PublishButton.Tooltip" DefaultValue="Click to publish a project" />
        <bt:String id="Contoso.TestFeedsButton.Tooltip" DefaultValue="Click to create a test feed for a project" />
        <bt:String id="Contoso.TestPubButton.Tooltip" DefaultValue="Click to publish a test project" />
        <bt:String id="Contoso.GetStarted.Description" DefaultValue="Click a publish option">
          <bt:Override Locale="ja-jp" Value="JA-JP Get Started Title" />
        </bt:String>  
      </bt:LongStrings>
    </Resources>
  </VersionOverrides>
</OfficeApp>

1 Ответ

0 голосов
/ 28 апреля 2020

Исключил необязательные элементы и обнаружил, что элемент <GetStarted> был оскорбительным элементом. Я удалил его и смог импортировать надстройку в Office Web.

...