Outlook 无法启动外接程序

Outlook 无法启动外接程序,outlook,ms-office,outlook-addin,office-js,Outlook,Ms Office,Outlook Addin,Office Js,我目前正在为Outlook开发外接程序,我遵循了创建外接程序的基本步骤,但每当我运行(未编辑的预生成)项目时,我都会遇到以下错误: 无法启动此加载项。关闭此对话框以忽略问题,或单击“重新启动”重试 我最初认为这可能与VisualStudioISS的HTTPS证书有关,但在安装这些证书(并测试它们在Chrome中工作)之后。我还更改了徽标以查看是否有任何效果,但它仍显示默认图像 有人知道我做错了什么吗?这是我目前的舱单: <?xml version="1.0" encoding="UTF-8

我目前正在为Outlook开发外接程序,我遵循了创建外接程序的基本步骤,但每当我运行(未编辑的预生成)项目时,我都会遇到以下错误:

无法启动此加载项。关闭此对话框以忽略问题,或单击“重新启动”重试

我最初认为这可能与VisualStudioISS的HTTPS证书有关,但在安装这些证书(并测试它们在Chrome中工作)之后。我还更改了徽标以查看是否有任何效果,但它仍显示默认图像

有人知道我做错了什么吗?这是我目前的舱单:

<?xml version="1.0" encoding="UTF-8"?>
<!--Created:ce44715c-8c4e-446b-879c-ea9ebe0f09c8-->
<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>d2240a8c-b832-493e-8056-5a14ca48a3f3</Id>

  <!--Version. Updates from the store only get triggered if there is a version change. -->
  <Version>1.0.0.0</Version>
  <ProviderName>DearBytes B.V.</ProviderName>
  <DefaultLocale>nl-NL</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="Test" />
  <Description DefaultValue="Test"/>
  <IconUrl DefaultValue="~remoteAppUrl/Images/icon64.png"/>

  <SupportUrl DefaultValue="https://www.test.com/" />
  <!-- 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>*.test.com</AppDomain>
    <AppDomain>*.test.nl</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="~remoteAppUrl/MessageRead.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" xsi:type="VersionOverridesV1_0">
    <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="~remoteAppUrl/Images/icon16.png"/>
        <bt:Image id="icon32" DefaultValue="~remoteAppUrl/Images/icon32.png"/>
        <bt:Image id="icon80" DefaultValue="~remoteAppUrl/Images/icon80.png"/>
        <bt:Image id="icon128" DefaultValue="~remoteAppUrl/Images/icon128.png"/>
      </bt:Images>
      <bt:Urls>
        <bt:Url id="functionFile" DefaultValue="~remoteAppUrl/Functions/FunctionFile.html"/>
        <bt:Url id="messageReadTaskPaneUrl" DefaultValue="~remoteAppUrl/MessageRead.html"/>
      </bt:Urls>
      <bt:ShortStrings>
        <bt:String id="groupLabel" DefaultValue="Test"/>
        <bt:String id="paneReadButtonLabel" DefaultValue="Test"/>
        <bt:String id="paneReadSuperTipTitle" DefaultValue="Test"/>
      </bt:ShortStrings>
      <bt:LongStrings>
        <bt:String id="paneReadSuperTipDescription" DefaultValue="Test"/>
      </bt:LongStrings>
    </Resources>
  </VersionOverrides>
</OfficeApp>

d2240a8c-b832-493e-8056-5a14ca48a3f3
1.0.0.0
迪尔拜茨酒店。
荷兰语

此错误最可能的原因是超时。在Outlook抛出错误之前,外接程序有5秒钟的时间执行Office.initialize方法

通常情况下,这是因为您没有引用
中的office.js库,或者在加载DOM之前没有执行office.initialize


您可以在发布的XML清单文件中找到有关引用office.js@

的详细信息,其中出现了9次
~remoteAppUrl
。如果尚未执行此操作,则应将每次出现的
~remoteAppUrl
替换为表示外接程序(web应用)文件部署位置的HTTPS URL


另外,正如@Slava Ivanov在上面的评论中提到的——我相信每个
AppDomain
值都应该是一个包含协议的URI(例如:
https://www.test.com
)。

这肯定是在脑子里,因为我没有改变任何东西,但是当我运行调试器时,代码甚至没有遇到任何断点,这意味着加载项根本没有加载我的JS;由于缺少错误反馈,在使用~remoteAppUrl时几乎无法调试。只有在Visual Studio中运行~remoteAppUrl时,它才会起作用。您是否看到输出窗口中出现任何错误?您用什么替换了“~remoteAppUrl”?您在部署清单之前是否执行了此操作?“AppDomain”必须包括URI(包括protocil)https://...“遗憾的是,这两个答案都不能解决我的问题。您是通过执行F5来运行和安装加载项,还是如何运行它?如果您是从VS运行的,~remoteAppUrl将自动为您替换为VS。此外,您的应用程序域中有*。不支持通配符。