繁体   English   中英

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

[英]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.

并参考文档验证策略5.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,因此这在您的实际清单中可能不是问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM