【问题标题】:Sorry, but we can't start this add-in because it isn't set up properly - Word Web Add-in抱歉,我们无法启动此加载项,因为它没有正确设置 - Word Web 加载项
【发布时间】:2019-06-13 08:59:45
【问题描述】:

我正在尝试使用 Sideloading 技术部署我的 Word Web 加载项。我使用 Visual Studio 2019 创建了加载项,但我想使用此方法运行加载项,而不是通过 VS 运行。

当我上传清单文件时,没有错误消息。但是,当我单击“显示任务窗格”时,加载项失败:

Add-In Error: Sorry, but we can't start this add-in because it isn't set up properly.

我遵循了侧载方法,将源位置 DefaultValue 更改为:

<SourceLocation DefaultValue="https://wordwebaddin1web20190612034303.azurewebsites.net/Home.html" />

我能够使用网络浏览器导航到 URL,并且页面加载成功。

整个清单文件如下所示:

<?xml version="1.0" encoding="UTF-8"?>
<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:ov="http://schemas.microsoft.com/office/taskpaneappversionoverrides"
          xsi:type="TaskPaneApp">

  <Id>0c420d45-c2da-4d36-aac4-eabc0a30844c</Id>

  <Version>1.0.0.0</Version>
  <ProviderName>Harry Levick</ProviderName>
  <DefaultLocale>en-US</DefaultLocale>

  <DisplayName DefaultValue="My Office Add-In" />
  <Description DefaultValue="A task pane add-in for Word"/>

  <IconUrl DefaultValue="~remoteAppUrl/Images/Button32x32.png" />

  <SupportUrl DefaultValue="http://www.contoso.com" />

  <AppDomains>
    <AppDomain>AppDomain1</AppDomain>
    <AppDomain>AppDomain2</AppDomain>
    <AppDomain>AppDomain3</AppDomain>
  </AppDomains>

  <Hosts>
    <Host Name="Document" />
  </Hosts>
  <DefaultSettings>
    <SourceLocation DefaultValue="https://wordwebaddin1web20190612034303.azurewebsites.net/Home.html" />
  </DefaultSettings>

  <Permissions>WriteDocument</Permissions>

  <VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0">

    <Hosts>
      <Host xsi:type="Document">
        <DesktopFormFactor>
          <GetStarted>
            <Title resid="Contoso.GetStarted.Title"/>

            <Description resid="Contoso.GetStarted.Description"/>

            <LearnMoreUrl resid="Contoso.GetStarted.LearnMoreUrl"/>
          </GetStarted>
          <FunctionFile resid="Contoso.DesktopFunctionFile.Url" />

          <ExtensionPoint xsi:type="PrimaryCommandSurface">

            <OfficeTab id="TabHome">
              <Group id="Contoso.Group1">
                <Label resid="Contoso.Group1Label" />
                <Icon>
                  <bt:Image size="16" resid="Contoso.tpicon_16x16" />
                  <bt:Image size="32" resid="Contoso.tpicon_32x32" />
                  <bt:Image size="80" resid="Contoso.tpicon_80x80" />
                </Icon>

                <Control xsi:type="Button" id="Contoso.TaskpaneButton">
                  <Label resid="Contoso.TaskpaneButton.Label" />
                  <Supertip>

                    <Title resid="Contoso.TaskpaneButton.Label" />

                    <Description resid="Contoso.TaskpaneButton.Tooltip" />
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="Contoso.tpicon_16x16" />
                    <bt:Image size="32" resid="Contoso.tpicon_32x32" />
                    <bt:Image size="80" resid="Contoso.tpicon_80x80" />
                  </Icon>

                  <Action xsi:type="ShowTaskpane">
                    <TaskpaneId>ButtonId1</TaskpaneId>
                    <SourceLocation resid="Contoso.Taskpane.Url" />
                  </Action>
                </Control>
              </Group>
            </OfficeTab>
          </ExtensionPoint>
        </DesktopFormFactor>
      </Host>
    </Hosts>

    <Resources>
      <bt:Images>
        <bt:Image id="Contoso.tpicon_16x16" DefaultValue="~remoteAppUrl/Images/Button16x16.png" />
        <bt:Image id="Contoso.tpicon_32x32" DefaultValue="~remoteAppUrl/Images/Button32x32.png" />
        <bt:Image id="Contoso.tpicon_80x80" DefaultValue="~remoteAppUrl/Images/Button80x80.png" />
      </bt:Images>
      <bt:Urls>
        <bt:Url id="Contoso.DesktopFunctionFile.Url" DefaultValue="~remoteAppUrl/Functions/FunctionFile.html" />
        <bt:Url id="Contoso.Taskpane.Url" DefaultValue="~remoteAppUrl/Home.html" />
        <bt:Url id="Contoso.GetStarted.LearnMoreUrl" DefaultValue="https://go.microsoft.com/fwlink/?LinkId=276812" />
      </bt:Urls>
      <bt:ShortStrings>
        <bt:String id="Contoso.TaskpaneButton.Label" DefaultValue="Show Taskpane" />
        <bt:String id="Contoso.Group1Label" DefaultValue="Commands Group" />
        <bt:String id="Contoso.GetStarted.Title" DefaultValue="Get started with your sample add-in!" />
      </bt:ShortStrings>
      <bt:LongStrings>
        <bt:String id="Contoso.TaskpaneButton.Tooltip" DefaultValue="Click to Show a Taskpane" />
        <bt:String id="Contoso.GetStarted.Description" DefaultValue="Your sample add-in loaded succesfully. Go to the HOME tab and click the 'Show Taskpane' button to get started." />
      </bt:LongStrings>
    </Resources>
  </VersionOverrides>

</OfficeApp>

【问题讨论】:

  • 作为实验,尝试用https://wordwebaddin1web20190612034303.azurewebsites.net 替换清单中出现的字符串~remoteAppUrl。然后旁加载新的清单。另外,您是侧载到 Office 桌面还是 Office Online?
  • 事实上,我在 azurewebsites.net 上找到了托管加载项的文档。它明确要求您更改 ~remoteAppUrl 字符串。请查看文章并确保您已按照以下步骤操作:Host an Office Add-in on Microsoft Azure

标签: xml ms-word office-js office-addins word-addins


【解决方案1】:

对于更通用的解决方案,还有一个验证器,它带有还允许侧载的 office-toolbox。

https://github.com/OfficeDev/office-toolbox

> office-toolbox validate -m manifest.xml

Calling validation service. This might take a moment...
-------------------------------------
Validation: Failed

Error #1:
Malformed Manifest Icon URL: The manifest icon URL must be well formed. 
Please see https://aka.ms/oackicon for details. (link: https://aka.ms/oackicon)
-------------------------------------

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多