Office附加清单文件通过'npm run validate',但是在向Office Web侧加载时失败

问题描述 投票:0回答:1

我正在任务功能区中创建一个命令按钮,该按钮为Office用户添加了一些功能。我开始使用yeoman generator,当我运行npm start时,外接程序在本地MS Excel上运行良好。它验证成功运行npm run validate

但是,当我尝试通过Excel在线加载manifest.xml进行测试(通过Office Add-ins > Upload My Add-in)时,我尝试上传清单,它立即返回消息:

Your add-in manifest is not valid.

对调试问题不是很有帮助的消息。这是我的第一个插件,所以我不确定该如何进行,任何帮助将不胜感激。外接manifest.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>
office365 ms-office office-js office-addins
1个回答
0
投票

消除了可选元素,发现<GetStarted>元素是有问题的。我删除了它,并能够将加载项导入Office Web。

© www.soinside.com 2019 - 2024. All rights reserved.