2017-07-31 114 views
1

我目前正在为Outlook开发一个插件,我遵循创建插件的基本步骤,但是每当我运行(未编辑的预生成)项目时,我都会得到以下内容错误:插件无法启动

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

我首先想到这可能与Visual Studio的ISS的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> 

截图错误:

enter image description here

+0

你用“〜remoteAppUrl”替换了什么?您是否在部署清单之前执行此操作? “AppDomain”必须包含URI,包括protocil“https:// ...” –

回答

0

此错误的最可能的原因是超时。在Outlook抛出错误之前,您的加载项需要5秒才能执行Office.initialize方法。

通常发生这种情况时,这是因为在加载DOM之前,您没有引用<head>中的office.js库,或者未执行Office.initialize。

你可以找到引用office.js细节@Understanding the JavaScript API for Office

+0

它绝对是头脑中的,因为我没有改变任何东西,但是当我运行调试器时代码甚至不会触发任何断点,这意味着加载项甚至没有加载我的JS;缺少错误反馈使得几乎不可能调试 – Paradoxis

+0

您正在使用〜remoteAppUrl,只有在Visual Studio中运行该程序时才会起作用。您是否在输出窗口中看到任何错误? –

0

在您发布的XML清单文件,有9次出现~remoteAppUrl。如果您尚未这样做,则应将每个出现~remoteAppUrl替换为代表加载项(Web应用程序)文件部署位置的HTTPS URL。

而且,如@Slava诺夫在上面的评论中提及 - 相信每个AppDomain值应该是一个URI,它包括协议(例如:https://www.test.com)。

+0

这两个答案可悲地不能解决我的问题 – Paradoxis

+0

您是否正在运行并通过执行F5安装插件,或者您如何运行它?如果你从VS运行,那么〜remoteAppUrl将由VS自动替换你。 此外,您的应用程序域中有*。通配符不受支持。 –

相关问题