仅命令加载项的 Office 365 清单

Office 365 Manifest for command-only Add-In

我有一个仅包含两个 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,对于我的仅命令加载项,这里的最佳实践是什么。谢谢

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

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

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

从技术上讲,此 SourceLocation URL 仍会出现在 identity token 的负载中,因此我建议将其设置为您的加载项独有的 URL。