IconUrl 的 Office 加载项验证失败,尽管它是 32x32 像素的图像

Office add-in validation fails for IconUrl though it is a 32x32 px image

我的清单中有以下行

<IconUrl DefaultValue="images/icon-32.png"/>

还有

<Host ...>
...
    <Control ...>
        ....
        <Icon>
            <bt:Image size="16" DefaultValue="images/icon-16.png"/>
            <bt:Image size="32" DefaultValue="images/icon-32.png"/>
            <bt:Image size="80" DefaultValue="images/icon-80.png"/>
        </Icon>
    </Control>

</Host>

但是当我提交审批时,我从 Office 商店团队收到以下错误。

The icon referenced in the IconUrl element of your add-in manifest must be 32x32 pixels in dimension.

并参考文档Validation Policies5.10

我已验证图像的 PNG 格式大小为 32x32 像素。测试加载项时,图标-32.png 加载到 Home menu panel

更新 下面添加完整的清单文件

<?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>aabbccdd-aabbccdd-aabbccdd-aabbccdd</Id>
    <Version>1.0</Version>
    <ProviderName>TestAddin</ProviderName>
    <DefaultLocale>en-US</DefaultLocale>
    <DisplayName DefaultValue="TestAddin" />
    <Description DefaultValue="A Test addin"/>
    <IconUrl DefaultValue="https://wireframepro.mockflow.com/integrations/office365/images/icon-32.png" />
    <SupportUrl DefaultValue="http://tesaddin.local" />
    <AppDomains>
        <AppDomain>http://tesaddin.local/</AppDomain>
    </AppDomains>
    <Hosts>
        <Host Name="Document" />
    </Hosts>
    <DefaultSettings>
        <SourceLocation DefaultValue="http://tesaddin.local/index.html" />
    </DefaultSettings>
    <Permissions>ReadWriteDocument</Permissions>
    <Requirements>
        <Sets DefaultMinVersion="1.1">
            <Set Name="WordApi" MinVersion="1.1"/>
        </Sets>
    </Requirements>
    <VersionOverrides 
        xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0">
        <Hosts>
            <Host xsi:type="Document">
                <DesktopFormFactor>
                    <GetStarted>
                        <Title resid="ACME.GetStarted.Title"/>
                        <Description resid="ACME.GetStarted.Description"/>
                        <LearnMoreUrl resid="ACME.GetStarted.LearnMoreUrl"/>
                    </GetStarted>
                    <ExtensionPoint xsi:type="PrimaryCommandSurface">
                        <OfficeTab id="TabHome">
                            <Group id="ACME.Group1">
                                <Label resid="ACME.Group1Label" />
                                <Icon>
                                    <bt:Image size="16" resid="ACME.tpicon_16x16" />
                                    <bt:Image size="32" resid="ACME.tpicon_32x32" />
                                    <bt:Image size="80" resid="ACME.tpicon_80x80" />
                                </Icon>
                                <Control xsi:type="Button" id="ACME.TaskpaneButton">
                                    <Label resid="ACME.TaskpaneButton.Label" />
                                    <Supertip>
                                        <Title resid="ACME.TaskpaneButton.Label" />
                                        <Description resid="ACME.TaskpaneButton.Tooltip" />
                                    </Supertip>
                                    <Icon>
                                        <bt:Image size="16" resid="ACME.tpicon_16x16" />
                                        <bt:Image size="32" resid="ACME.tpicon_32x32" />
                                        <bt:Image size="80" resid="ACME.tpicon_80x80" />
                                    </Icon>
                                    <Action xsi:type="ShowTaskpane">
                                        <TaskpaneId>ButtonId1</TaskpaneId>
                                        <SourceLocation resid="ACME.Taskpane.Url" />
                                    </Action>
                                </Control>
                            </Group>
                        </OfficeTab>
                    </ExtensionPoint>
                </DesktopFormFactor>
            </Host>
        </Hosts>
        <Resources>
            <bt:Images>
                <bt:Image id="ACME.tpicon_16x16" DefaultValue="https://wireframepro.mockflow.com/integrations/office365/images/icon-16.png" />
                <bt:Image id="ACME.tpicon_32x32" DefaultValue="https://wireframepro.mockflow.com/integrations/office365/images/icon-32.png" />
                <bt:Image id="ACME.tpicon_80x80" DefaultValue="https://wireframepro.mockflow.com/integrations/office365/images/icon-80.png" />
            </bt:Images>
            <bt:Urls>
                <bt:Url id="ACME.Taskpane.Url" DefaultValue="http://tesaddin.local/index.html" />
                <bt:Url id="ACME.GetStarted.LearnMoreUrl" DefaultValue="https://go.microsoft.com/fwlink/?LinkId=276812" />
            </bt:Urls>
            <bt:ShortStrings>
                <bt:String id="ACME.TaskpaneButton.Label" DefaultValue="Open Editor" />
                <bt:String id="ACME.Group1Label" DefaultValue="Test Addin" />
                <bt:String id="ACME.GetStarted.Title" DefaultValue="Get started with Test Addin" />
            </bt:ShortStrings>
            <bt:LongStrings>
                <bt:String id="ACME.TaskpaneButton.Tooltip" DefaultValue="Open Editor" />
                <bt:String id="ACME.GetStarted.Description" DefaultValue="Test add-in has been loaded succesfully. You can access the editor in HOME tab, click Open Editor" />
            </bt:LongStrings>
        </Resources>
    </VersionOverrides>
</OfficeApp>

我确认您 IconUrl 中引用的图像是 32x32。根据您发布的内容,我认为您的图片没有问题。我建议重新提交并提及您无法从之前的失败中复制图标问题。

您应该首先解决清单中的几个问题:

  1. requirements 元素应该紧跟在 hosts 元素之后。虽然这不应影响加载项,但它会启动自动验证脚本。只需将其移动到 hosts 之后,即可消除在清单验证期间被错误标记的情况。

  2. 你有几个对 http://tesaddin.local/index.html 的引用。需要加载项才能通过安全传输 (https) 进行操作。清单中唯一应该使用 http 的 URI 是 XML 模式引用。考虑到 .local,我认为这只是在 SO 上发帖的 URL,因此这在您的实际清单中可能不是问题。