Outlook加载项-VersionOverides不是OfficeApp的有效子元素

时间:2018-08-24 14:15:05

标签: javascript single-sign-on outlook-addin

我试图弄清楚如何对Outlook加载项进行单点登录身份验证。我有清单文件,但是每当尝试上传清单文件时,都会出现以下错误:

  

无法安装此应用。清单文件不符合架构定义。命名空间“ http://schemas.microsoft.com/office/appforoffice/1.1”中的元素“ OfficeApp”在命名空间“ http://schemas.microsoft.com/office/mailappversionoverrides/1.1”中具有无效的子元素“ VersionOverrides”。可能的元素列表:名称空间“ http://schemas.microsoft.com/office/mailappversionoverrides”中的“ VersionOverrides”以及名称空间“ http://www.w3.org/2000/09/xmldsig#”中的任何元素...名称空间“ http://schemas.microsoft.com/office/appforoffice/1.1”中的元素“ OfficeApp”具有命名空间“ http://schemas.microsoft.com/office/mailappversionoverrides/1.1”中的无效子元素“ VersionOverrides”。可能的元素列表:名称空间“ http://schemas.microsoft.com/office/mailappversionoverrides”中的“ VersionOverrides”以及名称空间“ http://www.w3.org/2000/09/xmldsig#”中的任何元素。

这是我的清单文件:

 <?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:mailappor="http://schemas.microsoft.com/office/mailappversionoverrides/1.0"
          xsi:type="MailApp">

  <!-- 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>[the id]</Id>

  <!--Version. Updates from the store only get triggered if there is a version change. -->
  <Version>1.0.0.0</Version>
  <ProviderName>Outlook Auth</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="outlookauth" />
  <Description DefaultValue="Outlook Auth Plugin"/>

  <!-- 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="https://localhost:3000" />

  <!-- 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>https://login.microsoftonline.com</AppDomain>
  </AppDomains>
  <!--End Basic Settings. -->

  <Hosts>
    <Host Name="Mailbox" />
  </Hosts>

  <Requirements>
    <Sets>
      <Set Name="Mailbox" MinVersion="1.1" />
    </Sets>
  </Requirements>

  <FormSettings>
    <Form xsi:type="ItemRead">
      <DesktopSettings>
        <SourceLocation DefaultValue="https://localhost:3000/index.html"/>
        <RequestedHeight>250</RequestedHeight>
      </DesktopSettings>
    </Form>
  </FormSettings>

  <Permissions>ReadWriteItem</Permissions>

  <Rule xsi:type="RuleCollection" Mode="Or">
    <Rule xsi:type="ItemIs" ItemType="Message" FormType="Read" />
  </Rule>

  <DisableEntityHighlighting>false</DisableEntityHighlighting>

  <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.1" xsi:type="VersionOverridesV1_1">

    <Requirements>
      <bt:Sets DefaultMinVersion="1.3">
        <bt:Set Name="Mailbox" />
      </bt:Sets>
    </Requirements>

    <Hosts>
      <Host xsi:type="MailHost">

        <DesktopFormFactor>
          <!-- Location of the Functions that UI-less buttons can trigger (ExecuteFunction Actions). -->
          <FunctionFile resid="functionFile" />

          <!-- Message Read -->
          <ExtensionPoint xsi:type="MessageReadCommandSurface">
            <!-- Use the default tab of the ExtensionPoint or create your own with <CustomTab id="myTab"> -->
            <OfficeTab id="TabDefault">
              <!-- Up to 6 Groups added per Tab -->
              <Group id="msgReadGroup">
                <Label resid="groupLabel" />
                <!-- Launch the add-in : task pane button -->
                <Control xsi:type="Button" id="msgReadOpenPaneButton">
                  <Label resid="paneReadButtonLabel" />
                  <Supertip>
                    <Title resid="paneReadSuperTipTitle" />
                    <Description resid="paneReadSuperTipDescription" />
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="icon16" />
                    <bt:Image size="32" resid="icon32" />
                    <bt:Image size="80" resid="icon80" />
                  </Icon>
                  <Action xsi:type="ShowTaskpane">
                    <SourceLocation resid="messageReadTaskPaneUrl" />
                  </Action>
                </Control>
                <!-- Go to http://aka.ms/ButtonCommands to learn how to add more Controls: ExecuteFunction and Menu -->
              </Group>
            </OfficeTab>
          </ExtensionPoint>
          <!-- Go to http://aka.ms/ExtensionPointsCommands to learn how to add more Extension Points: MessageRead, AppointmentOrganizer, AppointmentAttendee -->
        </DesktopFormFactor>
      </Host>
    </Hosts>

    <Resources>
      <bt:Images>
        <bt:Image id="icon16" DefaultValue="https://localhost:3000/assets/icon-16.png"/>
        <bt:Image id="icon32" DefaultValue="https://localhost:3000/assets/icon-32.png"/>
        <bt:Image id="icon80" DefaultValue="https://localhost:3000/assets/icon-80.png"/>
      </bt:Images>
      <bt:Urls>
        <bt:Url id="functionFile" DefaultValue="https://localhost:3000/function-file/function-file.html"/>
        <bt:Url id="messageReadTaskPaneUrl" DefaultValue="https://localhost:3000/index.html"/>
      </bt:Urls>
      <bt:ShortStrings>
        <bt:String id="groupLabel" DefaultValue="My Add-in Group"/>
        <bt:String id="customTabLabel"  DefaultValue="My Add-in Tab"/>
        <bt:String id="paneReadButtonLabel" DefaultValue="Display all properties"/>
        <bt:String id="paneReadSuperTipTitle" DefaultValue="Get all properties"/>
      </bt:ShortStrings>
      <bt:LongStrings>
        <bt:String id="paneReadSuperTipDescription" DefaultValue="Opens a pane displaying all available properties. This is an example of a button that opens a task pane."/>
      </bt:LongStrings>
    </Resources>

    <WebApplicationInfo>
      <Id>[id // i have it here]</Id>
      <Resource>api://localhost:3000/[id - i have it here]</Resource>
      <Scopes>
          <Scope>user.read</Scope>
          <Scope>profile</Scope>
      </Scopes>
    </WebApplicationInfo>

  </VersionOverrides>

</OfficeApp>

当我将VersionOverrides更改为VersionOverridesV1_0并使用xmlns = http://schemas.microsoft.com/office/mailappversionoverrides时,我收到一条错误消息,指出WebApplicationInfo不是VersionOverrides的有效子元素。

对此我还是一个初学者,所以对您的帮助表示赞赏。另外,如果您在示例中添加了一个Outlook外观,则只需一个实现sso的登录按钮,即可将我链接到其git repo。

1 个答案:

答案 0 :(得分:3)

根据Trello.get("cards/6a7c530bce987f166f2272ef/actions", function(err, comments) { $('#comments').html(comments[0].data.text); }); 元素上的documentation ...

  

较新版本的VersionOverrides元素必须是较旧版本的VersionOverrides元素的子元素。子VersionOverrides元素从父元素继承任何值。

当前支持两个版本,分别是v1.0或v1.1模式。要使用VersionOverrides的功能(您想使用VersionOverridesV1_1元素),需要将其包含在父元素WebApplicationInfo中。对于尚不支持v1.1或将不再支持的客户端,这是必需的。根据文档,VersionOverridesV1_0节的内容不会继承,因此您需要对其进行复制。您的清单(将正确安装)可能看起来像...

VersionOverrides