1

我将我的办公室更新为insider version,并且我customFunction正在工作。然后我将AllFormFactors标签添加到我的manifest.xmlVisual Studio给了我一个错误

AllFormFactors 是invalid

<!-- Form factor. Currently only DesktopFormFactor is supported. -->
<DesktopFormFactor>...</DesktopFormFactor>
<AllFormFactors>...</AllFormFactors>

提前致谢!

这是我的清单。

<?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">

  <!-- 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>a1225f90-b53e-4920-ae4b-2bc4a68c5176</Id>

  <!--Version. Updates from the store only get triggered if there is a version change. -->
  <Version>1.0.0.0</Version>
  <ProviderName>[dddd name]</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="My Office Add-in" />
  <Description DefaultValue="[Workbook Add-in description]"/>

  <!-- Icon for your add-in. Used on installation screens and the add-ins dialog. -->
  <IconUrl DefaultValue="https://localhost:3000/assets/icon-32.png" />
  <HighResolutionIconUrl DefaultValue="https://localhost:3000/assets/hi-res-icon.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="Workbook" />
  </Hosts>

  <DefaultSettings>
    <SourceLocation DefaultValue="https://localhost:3000/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="Workbook">
        <!-- 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. -->
          <!-- PrimaryCommandSurface 为 Office 主功能区。 -->
          <ExtensionPoint xsi:type="PrimaryCommandSurface">
            <!-- 使用 OfficeTab 来扩展现有选项卡。使用 CustomTab 来创建新选项卡。 -->
            <CustomTab id="TabTest">
              <!-- 确保为组提供唯一 ID。建议 ID 为使用公司名的命名空间。 -->
              <Group id="Contoso.Group1">
                <!-- 为组指定标签。resid 必须指向 ShortString 资源。 -->
                <Label resid="Contoso.Group1Label" />
                <!-- 图标。必需大小: 16、32、80,可选大小: 20、24、40、48、64。强烈建议为大 UX 提供所有大小。 -->
                <!-- 使用 PNG 图标。资源部分中的所有 URL 必须使用 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 xsi:type="Button" id="Contoso.TaskpaneButton">
                  <Label resid="Contoso.TaskpaneButton.Label" />
                  <Supertip>
                    <!-- 工具提示标题。resid 必须指向 ShortString 资源。 -->
                    <Title resid="Contoso.TaskpaneButton.Label" />
                    <!-- 工具提示标题。resid 必须指向 LongString 资源。 -->
                    <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>

                  <!-- 这是触发命令时的操作(例如单击功能区)。支持的操作为 ExecuteFunction 或 ShowTaskpane。 -->
                  <Action xsi:type="ShowTaskpane">
                    <TaskpaneId>ButtonId1</TaskpaneId>
                    <!-- 提供将显示在任务窗格上的位置的 URL 资源 ID。 -->
                    <SourceLocation resid="Contoso.Taskpane.Url" />
                  </Action>
                </Control>
              </Group>

              <Label resid="Contoso.hahaha"/>
            </CustomTab>
          </ExtensionPoint>

          <!-- ContextMenu extends selected context menus (E.g. right click menu)-->
          <ExtensionPoint xsi:type="ContextMenu">
            <!--The id of the menu specifies the existing context menu being extended-->
            <!--ContextMenuCell (Excel) and ContextMenuText (Word) are currently supported-->
            <OfficeMenu id="ContextMenuCell">
              <Control xsi:type="Menu" id="Contoso.TestMenu2">
                <Label resid="residLabel3" />
                <Supertip>
                  <Title resid="residLabel" />
                  <Description resid="residToolTip" />
                </Supertip>
                <Icon>
                  <bt:Image size="16" resid="icon1_32x32" />
                  <bt:Image size="32" resid="icon1_32x32" />
                  <bt:Image size="80" resid="icon1_32x32" />
                </Icon>
                <Items>
                  <Item id="showGallery2">
                    <Label resid="residLabel3"/>
                    <Supertip>
                      <Title resid="residLabel" />
                      <Description resid="residToolTip" />
                    </Supertip>
                    <Icon>
                      <bt:Image size="16" resid="icon1_32x32" />
                      <bt:Image size="32" resid="icon1_32x32" />
                      <bt:Image size="80" resid="icon1_32x32" />
                    </Icon>
                    <Action xsi:type="ShowTaskpane">
                      <!--TaskPaneId is required. It is currently not used by the framework but it will be in a future iteration -->
                      <TaskpaneId>MyTaskPaneID1</TaskpaneId>
                      <!--The URL to show inside the taskpane -->
                      <SourceLocation resid="residUnitConverterUrl" />
                    </Action>
                  </Item>
                  <Item id="showGallery3">
                    <Label resid="residLabel5"/>
                    <Supertip>
                      <Title resid="residLabel" />
                      <Description resid="residToolTip" />
                    </Supertip>
                    <Icon>
                      <bt:Image size="16" resid="icon1_32x32" />
                      <bt:Image size="32" resid="icon1_32x32" />
                      <bt:Image size="80" resid="icon1_32x32" />
                    </Icon>
                    <Action xsi:type="ShowTaskpane">
                      <TaskpaneId>MyTaskPaneID2</TaskpaneId>
                      <SourceLocation resid="residUnitConverterUrl" />
                    </Action>
                  </Item>
                </Items>
              </Control>
            </OfficeMenu>
          </ExtensionPoint>
        </DesktopFormFactor>


        <AllFormFactors>
          <ExtensionPoint xsi:type="CustomFunctions">
            <Script>
              <SourceLocation resid="functionsjs" />
            </Script>
            <Page>
              <SourceLocation resid="functionshtml"/>
            </Page>
          </ExtensionPoint>
        </AllFormFactors>
      </Host>
    </Hosts>

    <!-- You can use resources across hosts and form factors. -->
    <Resources>
      <bt:Images>
        <bt:Image id="Contoso.tpicon_16x16" DefaultValue="https://i.imgur.com/xV3upTT.png" />
        <bt:Image id="Contoso.tpicon_32x32" DefaultValue="https://i.imgur.com/xV3upTT.png" />
        <bt:Image id="Contoso.tpicon_80x80" DefaultValue="https://i.imgur.com/xV3upTT.png" />

        <bt:Image id="icon1_16x16" DefaultValue="https://i.imgur.com/xV3upTT.png">
          <bt:Override Locale="ja-jp" Value="https://i.imgur.com/xV3upTT.png" />
        </bt:Image>
        <bt:Image id="icon1_32x32" DefaultValue="https://i.imgur.com/kBw0iKX.png">
          <bt:Override Locale="ja-jp" Value="https://i.imgur.com/kBw0iKX.png" />
        </bt:Image>
        <bt:Image id="icon1_80x80" DefaultValue="https://i.imgur.com/xV3upTT.png">
          <bt:Override Locale="ja-jp" Value="https://i.imgur.com/xV3upTT.png" />
        </bt:Image>
        <bt:Image id="icon2_32x32" DefaultValue="https://i.imgur.com/LltG56v.png">
        </bt:Image>
        <bt:Image id="icon3_32x32" DefaultValue="https://i.imgur.com/SeiInaW.png">
        </bt:Image>
      </bt:Images>
      <bt:Urls>
        <bt:Url id="functionsjs" DefaultValue="https://localhost:3000/customfunctions.js" />
        <bt:Url id="functionshtml" DefaultValue="https://localhost:3000/customfunctions.html" />

        <bt:Url id="Contoso.Taskpane.Url" DefaultValue="https://localhost:3000/index.html" />
        <bt:Url id="Contoso.GetStarted.LearnMoreUrl" DefaultValue="https://go.microsoft.com/fwlink/?LinkId=276812" />
        <bt:Url id="Contoso.DesktopFunctionFile.Url" DefaultValue="https://localhost:3000/function-file/function-file.html" />

        <bt:Url id="residDesktopFuncUrl" DefaultValue="https://odsample.azurewebsites.net/Pages/Home.aspx?11">
          <bt:Override Locale="ja-jp" Value="https://odsample.azurewebsites.net/Pages/Home.aspx?11" />
        </bt:Url>
        <bt:Url id="residUnitConverterUrl" DefaultValue="https://odsample.azurewebsites.net/Pages/Home.aspx?33">
        </bt:Url>
        <!--LearnMore URL currently not used -->
        <bt:Url id="Contoso.GetStarted.LearnMoreUrl" DefaultValue="https://odsample.azurewebsites.net/Pages/GetStarted.html">
        </bt:Url>
      </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:String id="Contoso.hahaha" DefaultValue="hello tab" />

        <!-- ShortStrings max characters==125 -->
        <bt:String id="residLabel" DefaultValue="Get Data">
          <bt:Override Locale="ja-jp" Value="JA-JP Multiple Buttons" />
        </bt:String>
        <bt:String id="residLabel2" DefaultValue="Save Data">
          <bt:Override Locale="ja-jp" Value="JA-JP Multiple Buttons" />
        </bt:String>
        <bt:String id="residLabel3" DefaultValue="Compare Data">
          <bt:Override Locale="ja-jp" Value="JA-JP Multiple Buttons" />
        </bt:String>
        <bt:String id="residLabel4" DefaultValue="OData Integration">
          <bt:Override Locale="ja-jp" Value="JA-JP Multiple Buttons" />
        </bt:String>
        <bt:String id="residLabel5" DefaultValue="Another Command">
          <bt:Override Locale="ja-jp" Value="JA-JP Multiple Buttons" />
        </bt:String>
        <bt:String id="Contoso.GetStarted.Title" DefaultValue="OData Sample Loaded Successfully">
          <bt:Override Locale="ja-jp" Value="JA-JP Get Started Title" />
        </bt:String>
      </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." />

        <!-- LongStrings max characters==250 -->
        <bt:String id="residToolTip" DefaultValue="Multiple Buttons Tooltip">
          <bt:Override Locale="ja-jp" Value="JA-JP Multiple Buttons Tooltip" />
        </bt:String>
        <bt:String id="Contoso.GetStarted.Description" DefaultValue="Get going by opening the DATA tab on the Ribbon then click the ODATA INTEGRATION>GET DATA button to try this Add-in">
          <bt:Override Locale="ja-jp" Value="JA-JP Get Started Title" />
        </bt:String>
      </bt:LongStrings>
    </Resources>
  </VersionOverrides>
  <!-- End Add-in Commands Mode integration. -->

</OfficeApp>

这是我的控制台:

在此处输入图像描述

4

2 回答 2

1

问题:此问题是由 Visual Studio 的 XML 架构验证引起的。

原因: Microsoft 尚未将最新架构更新/发布到 Visual Studio 安装程序。

背景:如果您查看办公室清单(或任何 xml)的 xmlns 属性,这些 URL 并不指向 web。相反,它们是字符串比较并匹配到 Visual Studio 安装中的文件。这个问题导致/推动许多 .Net 开发人员使用 YeoMan 生成器使用 NodeJS 路由。

解决方案:

  1. 根据教程添加您的 AllFormFactors 标记(我的架构并不完美,因此顺序很重要)。
    <DesktopFormFactor>
    </DesktopFormFactor>
    <AllFormFactors>
      <ExtensionPoint xsi:type="CustomFunctions">
        <Script>
          <SourceLocation resid="Functions.Script.Url" />
        </Script>
        <Page>
          <SourceLocation resid="Functions.Page.Url"/>
        </Page>
        <Metadata>
          <SourceLocation resid="Functions.Metadata.Url" />
        </Metadata>
        <Namespace resid="Contoso.namespace" />
      </ExtensionPoint>
    </AllFormFactors>
  1. 打开您的 Office 清单 xml,顶部的 MenuBar 和 XML 菜单项将出现。单击架构。查找“ http://schemas.microsoft.com/office/taskpaneappversionoverrides ”。

  2. 如您所见,架构 URL 指向 Visual Studio 安装目录上的文件位置。

  3. 使用以下代码编辑该 .xsd 架构文件(首先进行备份):
            <?xml version="1.0" encoding="utf-8"?>
            <xs:schema id="TaskPaneAppVersionOverrides" elementFormDefault="qualified" version="1.0"
                targetNamespace="http://schemas.microsoft.com/office/taskpaneappversionoverrides"
                xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides"
                xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0"
                xmlns:odoc="http://schemas.microsoft.com/internal/obd"
                xmlns:xs="http://www.w3.org/2001/XMLSchema">

              <xs:import schemaLocation="OfficeAppBasicTypesV1_0.xsd" namespace="http://schemas.microsoft.com/office/officeappbasictypes/1.0" />

              <xs:complexType name="ShowTaskpane">
                <xs:annotation>
                  <xs:documentation>
                    Specifies a taskpane extension URL to display when a user interface extension point is invoked by the user.
                  </xs:documentation>
                </xs:annotation>
                <xs:complexContent>
                  <xs:extension base="Action">
                    <xs:sequence>
                      <xs:element name="TaskpaneId" type="bt:ShortString" minOccurs="0" maxOccurs="1"/>
                      <xs:element name="SourceLocation" type="bt:URLResourceReference" minOccurs="1" maxOccurs="1" />
                      <xs:element name="Title" type="bt:ShortResourceReference" minOccurs="0" maxOccurs="1" />
                    </xs:sequence>
                  </xs:extension>
                </xs:complexContent>
              </xs:complexType>

              <xs:complexType name="ExecuteFunction">
                <xs:annotation>
                  <xs:documentation>
                    Specifies a callback to execute when a user interface extension point is invoked by the user.
                  </xs:documentation>
                </xs:annotation>
                <xs:complexContent>
                  <xs:extension base="Action">
                    <xs:sequence>
                      <xs:element name="FunctionName" type="bt:LongString" minOccurs="1" maxOccurs="1" />
                    </xs:sequence>
                  </xs:extension>
                </xs:complexContent>
              </xs:complexType>

              <xs:complexType name="Action" abstract="true">
                <xs:annotation>
                  <xs:documentation>
                    Specifies an action to perform when a user interface extension point is invoked by the user.
                  </xs:documentation>
                </xs:annotation>
              </xs:complexType>

              <xs:complexType name="Supertip">
                <xs:annotation>
                  <xs:documentation>
                    Specifies the super tip for this control.
                  </xs:documentation>
                </xs:annotation>
                <xs:sequence>
                  <xs:element name="Title" type="bt:ShortResourceReference" minOccurs="1" maxOccurs="1" />
                  <xs:element name="Description" type="bt:LongResourceReference" minOccurs="1" maxOccurs="1" />
                </xs:sequence>
              </xs:complexType>

              <!-- Controls -->
              <xs:complexType name="UIControl" abstract="true">
                <xs:annotation>
                  <xs:documentation>
                    Specifies a user interface extension point of various kinds.
                  </xs:documentation>
                </xs:annotation>
                <xs:sequence>
                  <xs:element name="Label" type="bt:ShortResourceReference" minOccurs="1" maxOccurs="1" />
                  <xs:element name="Supertip" type="Supertip" minOccurs="1" maxOccurs="1" />
                </xs:sequence>
                <xs:attribute name="id" type="bt:ShortString" use="required">
                  <xs:annotation>
                    <xs:documentation>
                      The unique identifier of this control within the form factor.
                    </xs:documentation>
                  </xs:annotation>
                </xs:attribute>
              </xs:complexType>

              <xs:complexType name="UIControlWithIcon" abstract="true">
                <xs:annotation>
                  <xs:documentation>
                    Specifies a user interface extension point of various kinds that contain an icon.
                  </xs:documentation>
                </xs:annotation>
                <xs:complexContent>
                  <xs:extension base="UIControl">
                    <xs:sequence>
                      <xs:element name="Icon" type="bt:IconList" minOccurs="1" maxOccurs="1" />
                    </xs:sequence>
                  </xs:extension>
                </xs:complexContent>
              </xs:complexType>

              <xs:complexType name="UIControlWithOptionalIcon" abstract="true">
                <xs:annotation>
                  <xs:documentation>
                    Specifies a user interface extension point of various kinds that may or may not contain an icon.
                  </xs:documentation>
                </xs:annotation>
                <xs:complexContent>
                  <xs:extension base="UIControl">
                    <xs:sequence>
                      <xs:element name="Icon" type="bt:IconList" minOccurs="0" maxOccurs="1" />
                    </xs:sequence>
                  </xs:extension>
                </xs:complexContent>
              </xs:complexType>

              <xs:complexType name="Button">
                <xs:annotation>
                  <xs:documentation>
                    Specifies a user interface extension point that displays as a standard button.
                  </xs:documentation>
                </xs:annotation>
                <xs:complexContent>
                  <xs:extension base="UIControlWithIcon">
                    <xs:sequence>
                      <xs:element name="Action" type="Action" minOccurs="1" maxOccurs="1" />
                    </xs:sequence>
                  </xs:extension>
                </xs:complexContent>
              </xs:complexType>

              <xs:complexType name="MenuItem">
                <xs:annotation>
                  <xs:documentation>
                    Specifies a user interface extension point that displays as an item in a menu control.
                  </xs:documentation>
                </xs:annotation>
                <xs:complexContent>
                  <xs:extension base="UIControlWithOptionalIcon">
                    <xs:sequence>
                      <xs:element name="Action" type="Action" minOccurs="1" maxOccurs="1" />
                    </xs:sequence>
                  </xs:extension>
                </xs:complexContent>
              </xs:complexType>

              <xs:complexType name="MenuItems">
                <xs:annotation>
                  <xs:documentation>
                    Specifies a list of menu actions.
                  </xs:documentation>
                </xs:annotation>
                <xs:sequence>
                  <xs:element name="Item" type="MenuItem" minOccurs="1" maxOccurs="unbounded" />
                </xs:sequence>
              </xs:complexType>

              <xs:complexType name="Menu">
                <xs:annotation>
                  <xs:documentation>
                    Specifies a user interface extension point that displays as a menu of actions.
                  </xs:documentation>
                </xs:annotation>
                <xs:complexContent>
                  <xs:extension base="UIControlWithIcon">
                    <xs:sequence>
                      <xs:element name="Items" type="MenuItems" minOccurs="1" maxOccurs="1" />
                    </xs:sequence>
                  </xs:extension>
                </xs:complexContent>
              </xs:complexType>
              <!-- End controls -->

              <!-- Ribbon -->
              <xs:complexType name="Group">
                <xs:annotation>
                  <xs:documentation>
                    Specifies a specific group of user interface extension points in a tab in the Office client application.
                  </xs:documentation>
                </xs:annotation>
                <xs:sequence>
                  <xs:element name="Label" type="bt:ShortResourceReference" minOccurs="1" maxOccurs="1" />
                  <xs:element name="Icon" type="bt:IconList" minOccurs="1" maxOccurs="1" />
                  <xs:element name="Control" type="UIControl" minOccurs="1" maxOccurs="unbounded" />
                </xs:sequence>
                <xs:attribute name="id" type="bt:ShortString" use="required">
                  <xs:annotation>
                    <xs:documentation>
                      The unique identifier of this group within the form factor.
                    </xs:documentation>
                  </xs:annotation>
                </xs:attribute>
              </xs:complexType>

              <xs:complexType name="Tab" abstract="true">
                <xs:annotation>
                  <xs:documentation>
                    Specifies a tab in the Office client application where this Office add-in will customize the user interface.
                  </xs:documentation>
                </xs:annotation>
                <xs:sequence>
                  <xs:element name="Group" type="Group" minOccurs="1" maxOccurs="unbounded" />
                </xs:sequence>
                <xs:attribute name="id" type="bt:ShortString" use="required">
                  <xs:annotation>
                    <xs:documentation>
                      Specifies the identifier of the tab to which the child groups belong. If this tab is a CustomTab element, it is the identifier of the new tab. If it is an OfficeTab, it is the identifier of the preexisting Office UI tab in which to insert content.
                    </xs:documentation>
                  </xs:annotation>
                </xs:attribute>
              </xs:complexType>

              <xs:complexType name="OfficeMenu">
                <xs:annotation>
                  <xs:documentation>
                    Specifies a built-in menu of the Office client application to add this Office add-in
                  </xs:documentation>
                </xs:annotation>
                <xs:sequence>
                  <xs:element name="Control" type="UIControl" minOccurs="1" maxOccurs="unbounded" />
                </xs:sequence>
                <xs:attribute name="id" type="bt:ShortString" use="required">
                  <xs:annotation>
                    <xs:documentation>
                      Specifies the identifier of the built-in menu to which the controls will be added
                    </xs:documentation>
                  </xs:annotation>
                </xs:attribute>
              </xs:complexType>

              <xs:complexType name="OfficeTab">
                <xs:annotation>
                  <xs:documentation>
                    Specifies an extension to a pre-existing tab in the Office client application where this Office add-in will customize the user interface.
                  </xs:documentation>
                </xs:annotation>
                <xs:complexContent>
                  <xs:extension base="Tab" />
                </xs:complexContent>
              </xs:complexType>

              <xs:complexType name="CustomTab">
                <xs:annotation>
                  <xs:documentation>
                    Specifies an Office add-in defined tab in the Office client application where this Office add-in will customize the user interface.
                  </xs:documentation>
                </xs:annotation>
                <xs:complexContent>
                  <xs:extension base="Tab">
                    <xs:sequence>
                      <xs:element name="Label" type="bt:ShortResourceReference" minOccurs="1" maxOccurs="1" />
                    </xs:sequence>
                  </xs:extension>
                </xs:complexContent>
              </xs:complexType>

                <xs:complexType name="Script">
                <xs:annotation>
                  <xs:documentation>
                    Specifies an Office add-in defined tab in the Office client application where this Office add-in will customize the user interface.
                  </xs:documentation>
                </xs:annotation>
                    <xs:sequence>
                 <xs:element name="SourceLocation" type="bt:URLResourceReference" minOccurs="1" maxOccurs="1" />
                    </xs:sequence>
              </xs:complexType>



                <xs:complexType name="Page">
                <xs:annotation>
                  <xs:documentation>
                    Specifies an Office add-in defined tab in the Office client application where this Office add-in will customize the user interface.
                  </xs:documentation>
                </xs:annotation>
                <xs:sequence>
            <xs:element name="SourceLocation" type="bt:URLResourceReference" minOccurs="1" maxOccurs="1" />
                </xs:sequence>
              </xs:complexType>

                  <xs:complexType name="Metadata">
                <xs:annotation>
                  <xs:documentation>
                    Specifies an Office add-in defined tab in the Office client application where this Office add-in will customize the user interface.
                  </xs:documentation>
                </xs:annotation>
                    <xs:sequence>
            <xs:element name="SourceLocation" type="bt:URLResourceReference" minOccurs="1" maxOccurs="1" />
                    </xs:sequence>
              </xs:complexType>



              <xs:complexType name="Namespace">
                <xs:annotation>
                  <xs:documentation>
                    Specifies an Office add-in defined tab in the Office client application where this Office add-in will customize the user interface.
                  </xs:documentation>
                </xs:annotation>
                  <xs:attribute name="resid" type="bt:ShortString" use="required">
                  <xs:annotation>
                    <xs:documentation>
                      Specifies the identifier of the built-in menu to which the controls will be added
                    </xs:documentation>
                  </xs:annotation>
                </xs:attribute>
              </xs:complexType>
              <!-- End ribbon -->

              <!-- Extension points -->
              <xs:complexType name="ExtensionPoint" abstract="true">
                <xs:annotation>
                  <xs:documentation>
                    Specifies a location in the Office client application where the Office add-in exposes functionality.
                  </xs:documentation>
                </xs:annotation>
              </xs:complexType>

              <xs:complexType name="CommandSurfaceExtensionPoint" abstract="true">
                <xs:annotation>
                  <xs:documentation>
                    Specifies location in an Office client application's user interface where the Office add-in exposes functionality.
                  </xs:documentation>
                </xs:annotation>
                <xs:complexContent>
                  <xs:extension base="ExtensionPoint">
                    <xs:sequence>
                      <xs:element name="OfficeTab" type="OfficeTab" minOccurs="0" maxOccurs="unbounded" />
                      <xs:element name="CustomTab" type="CustomTab" minOccurs="0" maxOccurs="unbounded" />
                    </xs:sequence>
                  </xs:extension>
                </xs:complexContent>
              </xs:complexType>


                <xs:complexType name="CustomFunctions">
                <xs:annotation>
                  <xs:documentation>
                    Specifies location in an Office client application's user interface where the Office add-in exposes functionality.
                  </xs:documentation>
                </xs:annotation>
                <xs:complexContent>
                  <xs:extension base="ExtensionPoint">
                    <xs:sequence>
                      <xs:element name="Script" type="Script" minOccurs="0" maxOccurs="unbounded" />
                      <xs:element name="Page" type="Page" minOccurs="0" maxOccurs="unbounded" />
                      <xs:element name="Metadata" type="Metadata" minOccurs="0" maxOccurs="unbounded" />
                      <xs:element name="Namespace" type="Namespace" minOccurs="0" maxOccurs="1" />
                    </xs:sequence>
                  </xs:extension>
                </xs:complexContent>        
              </xs:complexType>



              <xs:complexType name="PrimaryCommandSurface">
                <xs:annotation>
                  <xs:documentation>
                    Specifies the ways this Office add-in exposes functionality through the primary command display of the Office client application (eg. Desktop Ribbon).
                  </xs:documentation>
                </xs:annotation>
                <xs:complexContent>
                  <xs:extension base="CommandSurfaceExtensionPoint" />
                </xs:complexContent>
              </xs:complexType>

              <xs:complexType name="ContextMenu">
                <xs:annotation>
                  <xs:documentation>
                    Specifies the ways this Office add-in exposes functionality through the context menus of the Office client application.
                  </xs:documentation>
                </xs:annotation>
                <xs:complexContent>
                  <xs:extension base="ExtensionPoint">
                    <xs:sequence>
                      <xs:element name="OfficeMenu" type="OfficeMenu" minOccurs="1" maxOccurs="unbounded" />
                    </xs:sequence>
                  </xs:extension>
                </xs:complexContent>
              </xs:complexType>
              <!-- End extension points-->

              <!-- Hosts and form factors -->
              <xs:complexType name="GetStarted">
                <xs:annotation>
                  <xs:documentation>
                    Specifies the Get Started information for the Office add-in. This information is used at various places on the Office User Interface after user installs an add-in.
                  </xs:documentation>
                </xs:annotation>
                <xs:sequence>
                  <xs:element name="Title" type="bt:ShortResourceReference" minOccurs="1" maxOccurs="1" />
                  <xs:element name="Description" type="bt:LongResourceReference" minOccurs="1" maxOccurs="1" />
                  <xs:element name="LearnMoreUrl" type="bt:URLResourceReference" minOccurs="1" maxOccurs="1"/>
                </xs:sequence>
              </xs:complexType>

              <xs:complexType name="FormFactor">
                <xs:annotation>
                  <xs:documentation>
                    Specifies the list of settings for the Office add-in when activated for a given form factor of the Office client application.
                  </xs:documentation>
                </xs:annotation>
                <xs:sequence>
                  <xs:element name="GetStarted" type="GetStarted" minOccurs="0" maxOccurs="1">
                    <xs:annotation>
                      <xs:documentation>Specifies the Get Started information for the Office add-in. This information is used at various places on the Office User Interface after user installs an add-in.</xs:documentation>
                    </xs:annotation>
                  </xs:element>
                  <xs:element name="FunctionFile" type="bt:URLResourceReference" minOccurs="0" maxOccurs="1">
                    <xs:annotation>
                      <xs:documentation>Specifies the source code file for the Office add-in, containing operations it exposes via its extension points, to use when loaded in this form factor.</xs:documentation>
                    </xs:annotation>
                  </xs:element>
                  <xs:element name="ExtensionPoint" type="ExtensionPoint" minOccurs="1" maxOccurs="unbounded">
                    <xs:annotation>
                      <xs:documentation>Specifies a location in an Office client application where the Office add-in registers itself to perform operations.</xs:documentation>
                    </xs:annotation>
                  </xs:element>
                </xs:sequence>
              </xs:complexType>

              <xs:complexType name="Host" abstract="true">
                <xs:annotation>
                  <xs:documentation>
                    Generic type for specifying Host node types under the Hosts element list
                  </xs:documentation>
                </xs:annotation>
              </xs:complexType>

              <xs:complexType name="Workbook">
                <xs:annotation>
                  <xs:documentation>
                    Defines add-in command extensions for Excel, including supported form factors.
                  </xs:documentation>
                </xs:annotation>
                <xs:complexContent>
                  <xs:extension base="Host">
                    <xs:sequence>
                      <xs:element name="DesktopFormFactor" type="FormFactor" minOccurs="0" maxOccurs="1">
                        <xs:annotation>
                          <xs:documentation>Specifies the settings of the Office add-in when running in a desktop version of Excel.</xs:documentation>
                        </xs:annotation>
                      </xs:element>
                      <xs:element name="AllFormFactors" type="FormFactor" minOccurs="0" maxOccurs="1">
                        <xs:annotation>
                          <xs:documentation>Specifies the settings of the Office add-in when running in a all version of Excel.</xs:documentation>
                        </xs:annotation>
                      </xs:element>
                    </xs:sequence>
                  </xs:extension>
                </xs:complexContent>
              </xs:complexType>

              <xs:complexType name="Document">
                <xs:annotation>
                  <xs:documentation>
                    Defines add-in command extensions for Word, including supported form factors.
                  </xs:documentation>
                </xs:annotation>
                <xs:complexContent>
                  <xs:extension base="Host">
                    <xs:sequence>
                      <xs:element name="DesktopFormFactor" type="FormFactor" minOccurs="0" maxOccurs="1">
                        <xs:annotation>
                          <xs:documentation>Specifies the settings of the Office add-in when running in a desktop version of Word.</xs:documentation>
                        </xs:annotation>
                      </xs:element>
                    </xs:sequence>
                  </xs:extension>
                </xs:complexContent>
              </xs:complexType>

              <xs:complexType name="Notebook">
                <xs:annotation>
                  <xs:documentation>
                    Defines add-in command extensions for OneNote, including supported form factors.
                  </xs:documentation>
                </xs:annotation>
                <xs:complexContent>
                  <xs:extension base="Host">
                    <xs:sequence>
                      <xs:element name="DesktopFormFactor" type="FormFactor" minOccurs="0" maxOccurs="1">
                        <xs:annotation>
                          <xs:documentation>Specifies the settings of the Office add-in when running in a desktop version of OneNote.</xs:documentation>
                        </xs:annotation>
                      </xs:element>
                    </xs:sequence>
                  </xs:extension>
                </xs:complexContent>
              </xs:complexType>

              <xs:complexType name="Presentation">
                <xs:annotation>
                  <xs:documentation>
                    Defines add-in command extensions for PowerPoint, including supported form factors.
                  </xs:documentation>
                </xs:annotation>
                <xs:complexContent>
                  <xs:extension base="Host">
                    <xs:sequence>
                      <xs:element name="DesktopFormFactor" type="FormFactor" minOccurs="0" maxOccurs="1">
                        <xs:annotation>
                          <xs:documentation>Specifies the settings of the Office add-in when running in a desktop version of PowerPoint.</xs:documentation>
                        </xs:annotation>
                      </xs:element>
                    </xs:sequence>
                  </xs:extension>
                </xs:complexContent>
              </xs:complexType>

              <xs:complexType name="Hosts">
                <xs:annotation>
                  <xs:documentation>
                    Specifies the Office client application types where an Office add-in will be activated.
                  </xs:documentation>
                </xs:annotation>
                <xs:sequence minOccurs="1" maxOccurs="unbounded">
                  <xs:element name="Host" type="Host">
                    <xs:annotation>
                      <xs:documentation>
                        Specifies the Office client application where an Office add-in will be activated.
                      </xs:documentation>
                    </xs:annotation>
                  </xs:element>
                </xs:sequence>
              </xs:complexType>
              <!-- End hosts and form factors -->

              <xs:complexType name="WebApplicationScopes">
                <xs:annotation>
                  <xs:documentation>
                    Specifies the scope strings for any permissions that your application needs to external resources.
                  </xs:documentation>
                </xs:annotation>
                <xs:sequence minOccurs="1" maxOccurs="unbounded">
                  <xs:element name="Scope" type="bt:LongString">
                    <xs:annotation>
                      <xs:documentation>
                        Specifies the scope string for one permission that your application needs to external resources.
                      </xs:documentation>
                    </xs:annotation>
                  </xs:element>
                </xs:sequence>
              </xs:complexType>

              <xs:complexType name="WebApplicationInfo">
                <xs:annotation>
                  <xs:documentation>
                    A parent node for SSO node: Id, Resource and Scopes.
                  </xs:documentation>
                </xs:annotation>
                <xs:sequence minOccurs="1" maxOccurs="1">
                  <xs:element name="Id" type="bt:UUID" minOccurs="1" maxOccurs="1">
                    <xs:annotation>
                      <xs:documentation>Specifies the client id of your multi-tenant application as registered with Microsoft.</xs:documentation>
                    </xs:annotation>
                  </xs:element>
                  <xs:element name="Resource" type="bt:LongString" minOccurs="1" maxOccurs="1">
                    <xs:annotation>
                      <xs:documentation>Specifies the resource for your application’s Web API.</xs:documentation>
                    </xs:annotation>
                  </xs:element>
                  <xs:element name="Scopes" type="WebApplicationScopes" minOccurs="1" maxOccurs="1">
                    <xs:annotation>
                      <xs:documentation>Specifies the scope strings for any permissions that your application needs to external resources.</xs:documentation>
                    </xs:annotation>
                  </xs:element>
                </xs:sequence>
              </xs:complexType>

              <xs:complexType name="VersionOverridesV1_0">
                <xs:annotation>
                  <xs:documentation>
                    Contains elements for the version 1.0 overrides of the Office task pane add-in manifest.
                  </xs:documentation>
                </xs:annotation>
                <xs:sequence>
                  <xs:element name="Description" type="bt:LongResourceReference" minOccurs="0" maxOccurs="1">
                    <xs:annotation>
                      <xs:documentation>Specifies a more verbose description of the Office add-in. Overrides the Description element in the parent node of this element in the manifest</xs:documentation>
                    </xs:annotation>
                  </xs:element>
                  <xs:element name="Requirements" type="bt:Requirements" minOccurs="0" maxOccurs="1">
                    <xs:annotation>
                      <xs:documentation>Specifies the minimum set of Office.js requirements that the Office add-in needs to activate. Overrides the Requirements element in the parent node of this element in the manifest.</xs:documentation>
                    </xs:annotation>
                  </xs:element>
                  <xs:element name="Hosts" type="Hosts" minOccurs="0" maxOccurs="1">
                    <xs:annotation>
                      <xs:documentation>Specifies a collection of Office client application types. Overrides the Hosts element in the parent node of this element in the manifest.</xs:documentation>
                    </xs:annotation>
                  </xs:element>
                  <xs:element name="Resources" type="bt:Resources" minOccurs="0" maxOccurs="1">
                    <xs:annotation>
                      <xs:documentation>Specifies a collection of resources referenced by other elements of the manifest where resource references are supported.</xs:documentation>
                    </xs:annotation>
                  </xs:element>
                  <xs:element name="WebApplicationInfo" type="WebApplicationInfo" minOccurs="0" maxOccurs="1">
                    <xs:annotation>
                      <xs:documentation>A parent node for SSO node: WebApplicationId, WebApplicationResource and WebApplicationScopes.</xs:documentation>
                    </xs:annotation>
                  </xs:element>
                  <xs:any id="VersionOverrides" minOccurs="0" maxOccurs="1" namespace="http://schemas.microsoft.com/office/taskpaneappversionoverrides/1.1" processContents="lax">
                    <xs:annotation>
                      <xs:documentation>Contains elements for use in future versions of the Office add-in platform as they release. These elements may be overrides to previously defined elements or new elements.</xs:documentation>
                    </xs:annotation>
                   </xs:any>
                </xs:sequence>
              </xs:complexType>

              <xs:element name="VersionOverrides" type="VersionOverridesV1_0">
                <xs:annotation>
                  <xs:documentation>Specifies a collection of Office client application types. Data defined in this element overrides the same data present in the parent node of this element in the manifest for Office client applications that support this extended manifest content.</xs:documentation>
                </xs:annotation>
              </xs:element>

            </xs:schema>

提示:到目前为止,我什至删除了解决方案中的默认 Web 项目,并添加了一个带有身份验证的 ASP.Net Core Web 项目,我的清单成功指向了该 URL;)

于 2019-08-12T08:03:46.170 回答
0

这是架构验证错误。您收到此信息是因为AllFormFactors仍处于预览状态,而不是已发布架构定义的一部分。

但是,这不应阻止您在 Excel 中旁加载您的加载项。

于 2018-03-23T14:50:12.497 回答