3

I'm currently developing an add-in for Outlook, I followed the basic steps in creating an add in, but whenever I run (the unedited pre-generated) project, I get the following error:

This add-in could not be started. Close this dialog to ignore the problem or click "Restart" to try again.

I first thought this might be related to Visual Studio ISS's HTTPS certificates, but after installing those (and testing that they work in Chrome). I also changed the logo to see if that had any effect but it keeps showing the default image.

Does anyone know what I'm doing wrong? This is my current manifest:

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

Screenshot of the error:

enter image description here

Paradoxis
  • 4,471
  • 7
  • 32
  • 66
  • What did you replace "~remoteAppUrl" with? Did you do this before deploying the manifest? "AppDomain" has to include URI including protocil "https://..." – Slava Ivanov Jul 31 '17 at 15:59

2 Answers2

0

The most likely cause of this error is a timeout. Your add-in has 5 seconds to execute the Office.initialize method before Outlook tosses up an error.

Generally when this happens, it is because you're not referencing the office.js library in the <head> or your not executing Office.initialize until after the DOM is loaded.

You can find details on referencing office.js @ Understanding the JavaScript API for Office

Marc LaFleur
  • 31,987
  • 4
  • 37
  • 63
  • It's definitely in the head since I didn't change anything, but the code doesn't even hit any breakpoints when I run the debugger which means the add-in isn't even loading my JS at all; the lack of error feedback makes it almost impossible to debug – Paradoxis Jul 31 '17 at 15:37
  • You're using ~remoteAppUrl which would only work if you're running this from within Visual Studio. Are you seeing any error surfaced in the output window? – Marc LaFleur Aug 01 '17 at 19:58
0

In the XML manifest file that you posted, there are 9 occurrences of ~remoteAppUrl. If you haven't already done so, you should replace each occurrence of ~remoteAppUrl with the HTTPS URL that represents where the add-in's (web app) files are deployed.

Also, as @Slava Ivanov mentioned in the comment above -- I believe each AppDomain value should be a URI that includes the protocol (ex: https://www.test.com).

Kim Brandl
  • 13,125
  • 2
  • 16
  • 21
  • Both answers sadly don't fix my problem – Paradoxis Aug 10 '17 at 14:00
  • Are you running and installing addin by executing F5, or how are you running it? If you are running from VS, then the ~remoteAppUrl will get replaced automatically for you by VS. Also, you have * in your app domains. Wildcards aren't supported. – Outlook Add-ins Team - MSFT Aug 10 '17 at 16:55