【问题标题】:Office add-in validation fails for IconUrl though it is a 32x32 px imageIconUrl 的 Office 加载项验证失败,尽管它是 32x32 像素的图像
【发布时间】:2017-10-02 03:09:10
【问题描述】:

我的清单中有以下行

<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

我已验证图像的大小正好为 32x32 像素(PNG 格式)。在测试插件时,icon-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>

【问题讨论】:

  • 你能提供一个链接到实际图像和清单文件的其余部分(当然是清除 id 和名称)。
  • @MarcLaFleur-MSFT 已包含完整的清单文件

标签: ms-word office-js office-store


【解决方案1】:

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

您的清单有几个问题需要首先解决:

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

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

【讨论】:

  • 它有帮助。您提到的另一个问题只是在 SO 中发布的占位符。还有一个问题,有没有一种方法可以告诉我清单中的 IE11 不支持加载项,因为存在 cookie 问题(在 iframe 对话框中加载的应用程序)并且加载项因此被拒绝。
  • 请单独发布其他问题。评论对于其他问题来说是一种无效的媒介。
猜你喜欢
  • 2019-04-11
  • 1970-01-01
  • 2019-09-24
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多