首页 > 解决方案 > 适用于仅命令加载项的 Office 365 清单

问题描述

我有一个仅包含两个 ExecuteFunction 命令的加载项。在 Visual Studio 生成的清单文件中,它包含如下 xml:

<FormSettings>
    <Form xsi:type="ItemRead">
        <DesktopSettings>
            <SourceLocation DefaultValue="https://localhost:44351/MessageRead.html"/>
            <!--If you opt to include RequestedHeight, it must be between 32px to 450px, inclusive.-->
            <RequestedHeight>250</RequestedHeight>
        </DesktopSettings>
    </Form>
</FormSettings>

由于我在任务窗格中没有任何 UI,为什么它需要这个 xml,以及对于我的仅命令加载项来说,这里的最佳实践是什么。谢谢。

标签: outlookoffice365office-jsadd-in

解决方案


此 XML 的存在是为了与旧版 Outlook 客户端兼容,并且是清单架构所必需的。

作为最佳实践,由于您的加载项仅使用加载项命令,请将清单中设置的最低要求设置为至少1.3,因此不支持加载项的客户端不会使用清单和此 URL命令。

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

从技术上讲,这个 SourceLocation URL 仍然出现在identity token的有效负载中,所以我建议将它设置为对您的加载项唯一的 URL。


推荐阅读