抱歉,我们无法启动此加载项,因为它未正确设置 - Word Web 加载项

Sorry, but we can't start this add-in because it isn't set up properly - Word Web Add-in

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

当我上传清单文件时,没有任何错误消息。但是,当我单击 'show taskpane' 时,加载项失败并显示:

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

我通过将源位置默认值更改为:

来遵循旁加载方法

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

还有一个更通用的解决方案,有一个验证器,它带有 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)
-------------------------------------