manifest - 为什么这个带有 MobileFormFactor 的 xml 文件不能用于办公室插件工作
问题描述
我正在尝试在线遵循几个示例,将移动任务窗格添加到我的办公室加载项应用程序中,但现在似乎陷入了这个错误。出了什么问题。“安装失败:版本覆盖 1.0 秒的清单无效。MobileFormFactor 标记无效”
我用来模式化的指南是https://github.com/OfficeDev/outlook-add-in-command-demo/blob/master/command-demo-manifest.xml
如果我删除内部 VersionOverrides 标签,这将安装得很好。
<?xml version="1.0" encoding="UTF-8"?>
<OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0" xmlns:mailappor="http://schemas.microsoft.com/office/mailappversionoverrides/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="MailApp">
<!-- Begin Basic Settings: Add-in metadata, used for all versions of Office unless override provided. -->
<!-- IMPORTANT! Id must be unique for your add-in, if you reuse this manifest ensure that you change this id to a new GUID. -->
<Id>some-id</Id>
<!--Version. Updates from the store only get triggered if there is a version change. -->
<Version>1.0.0.0</Version>
<ProviderName>Red Planet</ProviderName>
<DefaultLocale>en-US</DefaultLocale>
<!-- The display name of your add-in. Used on the store and various places of the Office UI such as the add-ins dialog. -->
<DisplayName DefaultValue="Red Planet special" />
<Description DefaultValue="Red Planet Outlook special Support" />
<!-- Icon for your add-in. Used on installation screens and the add-ins dialog. -->
<IconUrl DefaultValue="https://somedomain/assets/icon.png" />
<HighResolutionIconUrl DefaultValue="https://somedomain/assets/icon.png" />
<!--If you plan to submit this add-in to the Office Store, uncomment the SupportUrl element below-->
<!-- <SupportUrl DefaultValue="[Insert the URL of a page that provides support information for the app]" /> -->
<!-- Domains that will be allowed when navigating. For example, if you use ShowTaskpane and then have an href link, navigation will only be allowed if the domain is on this list. -->
<AppDomains>
<AppDomain>https://somedomain</AppDomain>
<AppDomain>https://somedomain</AppDomain>
<!-- <AppDomain>AppDomain3</AppDomain> -->
</AppDomains>
<!--End Basic Settings. -->
<Hosts>
<Host Name="Mailbox" />
</Hosts>
<Requirements>
<Sets>
<Set Name="Mailbox" MinVersion="1.1" />
</Sets>
</Requirements>
<FormSettings>
<Form xsi:type="ItemRead">
<DesktopSettings>
<SourceLocation DefaultValue="https://somedomain/index.html" />
<RequestedHeight>250</RequestedHeight>
</DesktopSettings>
</Form>
</FormSettings>
<Permissions>ReadWriteMailbox</Permissions>
<Rule xsi:type="RuleCollection" Mode="Or">
<Rule xsi:type="ItemIs" ItemType="Message" FormType="ReadOrEdit" />
</Rule>
<DisableEntityHighlighting>false</DisableEntityHighlighting>
<VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides" xsi:type="VersionOverridesV1_0">
<Requirements>
<bt:Sets DefaultMinVersion="1.5">
<bt:Set Name="Mailbox" />
</bt:Sets>
</Requirements>
<Hosts>
<Host xsi:type="MailHost">
<DesktopFormFactor>
<!-- Location of the Functions that UI-less buttons can trigger (ExecuteFunction Actions). -->
<FunctionFile resid="fnFile" />
<!-- Message Read -->
<ExtensionPoint xsi:type="MessageReadCommandSurface">
<!-- Use the default tab of the ExtensionPoint or create your own with <CustomTab id="myTab"> -->
<OfficeTab id="TabDefault">
<!-- Up to 6 Groups added per Tab -->
<Group id="msgReadGroup">
<Label resid="groupLabel" />
<!-- Launch the add-in : task pane button -->
<Control xsi:type="Button" id="msgReadOpenPaneButton">
<Label resid="paneReadButtonLabel" />
<Supertip>
<Title resid="paneReadSuperTipTitle" />
<Description resid="paneReadSuperTipDescription" />
</Supertip>
<Icon>
<bt:Image size="16" resid="icon16" />
<bt:Image size="32" resid="icon32" />
<bt:Image size="80" resid="icon80" />
</Icon>
<Action xsi:type="ExecuteFunction">
<FunctionName>showspecialModal</FunctionName>
</Action>
</Control>
</Group>
</OfficeTab>
</ExtensionPoint>
<ExtensionPoint xsi:type="MessageComposeCommandSurface">
<!-- Use the default tab of the ExtensionPoint or create your own with <CustomTab id="myTab"> -->
<OfficeTab id="TabDefault2">
<!-- Up to 6 Groups added per Tab -->
<Group id="msgReadGroup2">
<Label resid="groupLabel" />
<!-- Launch the add-in : task pane button -->
<Control xsi:type="Button" id="msgReadOpenPaneButton2">
<Label resid="paneReadButtonLabel" />
<Supertip>
<Title resid="paneReadSuperTipTitle" />
<Description resid="paneReadSuperTipDescription" />
</Supertip>
<Icon>
<bt:Image size="16" resid="icon16" />
<bt:Image size="32" resid="icon32" />
<bt:Image size="80" resid="icon80" />
</Icon>
<Action xsi:type="ExecuteFunction">
<FunctionName>showspecialModal</FunctionName>
</Action>
</Control>
</Group>
</OfficeTab>
</ExtensionPoint>
<!-- Go to http://aka.ms/ExtensionPointsCommands to learn how to add more Extension Points: MessageRead, AppointmentOrganizer, AppointmentAttendee -->
</DesktopFormFactor>
</Host>
</Hosts>
<Resources>
<bt:Images>
<bt:Image id="icon16" DefaultValue="https://somedomain/assets/icon.png" />
<bt:Image id="icon32" DefaultValue="https://somedomain/assets/icon.png" />
<bt:Image id="icon80" DefaultValue="https://somedomain/assets/icon.png" />
</bt:Images>
<bt:Urls>
<bt:Url id="fnFile" DefaultValue="https://somedomain/#functions" />
<bt:Url id="messageReadTaskPaneUrl" DefaultValue="https://somedomain/#task-pane" />
</bt:Urls>
<bt:ShortStrings>
<bt:String id="groupLabel" DefaultValue="Red Planet" />
<bt:String id="customTabLabel" DefaultValue="Red Planet Tab" />
<bt:String id="paneReadButtonLabel" DefaultValue="special Reply" />
<bt:String id="paneReadSuperTipTitle" DefaultValue="Get all properties" />
<bt:String id="groupLabel2" DefaultValue="Red Planet2" />
<bt:String id="customTabLabel2" DefaultValue="Red Planet Tab2" />
<bt:String id="paneReadButtonLabel2" DefaultValue="special Reply2" />
<bt:String id="paneReadSuperTipTitle2" DefaultValue="Get all properties2" />
</bt:ShortStrings>
<bt:LongStrings>
<bt:String id="paneReadSuperTipDescription" DefaultValue="Open up the special send dialog." />
<bt:String id="paneReadSuperTipDescription2" DefaultValue="Open up the special send dialog." />
</bt:LongStrings>
</Resources>
<VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.1" xsi:type="VersionOverridesV1_1">
<Requirements>
<bt:Sets DefaultMinVersion="1.3">
<bt:Set Name="Mailbox" />
</bt:Sets>
</Requirements>
<Hosts>
<Host xsi:type="MailHost">
<MobileFormFactor>
<FunctionFile resid="fnFile" />
<ExtensionPoint xsi:type="MobileMessageReadCommandSurface">
<Group id="mobileGroupID">
<Label resid="residAppName" />
<Control xsi:type="MobileButton" id="TaskPaneBtn">
<Label resid="residTaskPaneButtonName" />
<Icon xsi:type="bt:MobileIconList">
<bt:Image size="25" scale="1" resid="icon16" />
<bt:Image size="25" scale="2" resid="icon16" />
<bt:Image size="25" scale="3" resid="icon16" />
<bt:Image size="32" scale="1" resid="icon16" />
<bt:Image size="32" scale="2" resid="icon16" />
<bt:Image size="32" scale="3" resid="icon16" />
<bt:Image size="48" scale="1" resid="icon16" />
<bt:Image size="48" scale="2" resid="icon16" />
<bt:Image size="48" scale="3" resid="icon16" />
</Icon>
<Action xsi:type="ShowTaskpane">
<SourceLocation resid="messageReadTaskPaneUrl" />
</Action>
</Control>
</Group>
</ExtensionPoint>
</MobileFormFactor>
</Host>
</Hosts>
<Resources>
<bt:Images>
<bt:Image id="icon16" DefaultValue="https://somedomain/assets/icon.png" />
<bt:Image id="icon32" DefaultValue="https://somedomain/assets/icon.png" />
<bt:Image id="icon80" DefaultValue="https://somedomain/assets/icon.png" />
</bt:Images>
<bt:Urls>
<bt:Url id="fnFile" DefaultValue="https://somedomain/#functions" />
<bt:Url id="messageReadTaskPaneUrl" DefaultValue="https://somedomain/#task-pane" />
</bt:Urls>
<bt:ShortStrings>
<bt:String id="residTaskPaneButtonName" DefaultValue="Mobile test" />
<bt:String id="residAppName" DefaultValue="Mobile Testing" />
<bt:String id="residTaskpaneUrl" DefaultValue="Mobile test2" />
</bt:ShortStrings>
<bt:LongStrings>
<bt:String id="paneReadSuperTipDescription" DefaultValue="Open up the special send dialog." />
<bt:String id="paneReadSuperTipDescription2" DefaultValue="Open up the special send dialog." />
</bt:LongStrings>
</Resources>
</VersionOverrides>
</VersionOverrides>
</OfficeApp>
解决方案
您发布的清单中有几个问题...
DefaultMinVersion
(VersionOverridesV1_0
1.5) 部分的值不能高于VersionOverridesV1_1
(1.3) 中的规定。Url
资源应该指向.html
文件,包括FunctionFile
.VersionOverridesV1_1
section 不会从VersionOverridesV1_0
section 中获取任何内容,您必须在里面重复ExtensionPoint
和适当。Resources
VersionOverridesV1_1
当你修复上面的所有点时,清单应该看起来像下面的 XML 并且可以工作......
<?xml version="1.0" encoding="UTF-8"?>
<OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0" xmlns:mailappor="http://schemas.microsoft.com/office/mailappversionoverrides/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="MailApp">
<!-- Begin Basic Settings: Add-in metadata, used for all versions of Office unless override provided. -->
<!-- IMPORTANT! Id must be unique for your add-in, if you reuse this manifest ensure that you change this id to a new GUID. -->
<Id>your_id</Id>
<!--Version. Updates from the store only get triggered if there is a version change. -->
<Version>1.0.0.0</Version>
<ProviderName>Red Planet</ProviderName>
<DefaultLocale>en-US</DefaultLocale>
<!-- The display name of your add-in. Used on the store and various places of the Office UI such as the add-ins dialog. -->
<DisplayName DefaultValue="Red Planet special" />
<Description DefaultValue="Red Planet Outlook special Support" />
<!-- Icon for your add-in. Used on installation screens and the add-ins dialog. -->
<IconUrl DefaultValue="https://localhost:44300/Images/app-32.png" />
<HighResolutionIconUrl DefaultValue="https://localhost:44300/Images/app-80.png" />
<!--If you plan to submit this add-in to the Office Store, uncomment the SupportUrl element below-->
<!-- <SupportUrl DefaultValue="[Insert the URL of a page that provides support information for the app]" /> -->
<!-- Domains that will be allowed when navigating. For example, if you use ShowTaskpane and then have an href link, navigation will only be allowed if the domain is on this list. -->
<AppDomains>
<AppDomain>https://somedomain.com</AppDomain>
<AppDomain>https://somedomain.com</AppDomain>
<!-- <AppDomain>AppDomain3</AppDomain> -->
</AppDomains>
<!--End Basic Settings. -->
<Hosts>
<Host Name="Mailbox" />
</Hosts>
<Requirements>
<Sets>
<Set Name="Mailbox" MinVersion="1.1" />
</Sets>
</Requirements>
<FormSettings>
<Form xsi:type="ItemRead">
<DesktopSettings>
<SourceLocation DefaultValue="https://localhost:44300/index.html" />
<RequestedHeight>250</RequestedHeight>
</DesktopSettings>
</Form>
</FormSettings>
<Permissions>ReadWriteMailbox</Permissions>
<Rule xsi:type="RuleCollection" Mode="Or">
<Rule xsi:type="ItemIs" ItemType="Message" FormType="ReadOrEdit" />
</Rule>
<DisableEntityHighlighting>false</DisableEntityHighlighting>
<VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides" xsi:type="VersionOverridesV1_0">
<Requirements>
<bt:Sets DefaultMinVersion="1.5">
<bt:Set Name="Mailbox" />
</bt:Sets>
</Requirements>
<Hosts>
<Host xsi:type="MailHost">
<DesktopFormFactor>
<!-- Location of the Functions that UI-less buttons can trigger (ExecuteFunction Actions). -->
<FunctionFile resid="fnFile" />
<!-- Message Read -->
<ExtensionPoint xsi:type="MessageReadCommandSurface">
<!-- Use the default tab of the ExtensionPoint or create your own with <CustomTab id="myTab"> -->
<OfficeTab id="TabDefault">
<!-- Up to 6 Groups added per Tab -->
<Group id="msgReadGroup">
<Label resid="groupLabel" />
<!-- Launch the add-in : task pane button -->
<Control xsi:type="Button" id="msgReadOpenPaneButton">
<Label resid="paneReadButtonLabel" />
<Supertip>
<Title resid="paneReadSuperTipTitle" />
<Description resid="paneReadSuperTipDescription" />
</Supertip>
<Icon>
<bt:Image size="16" resid="icon16" />
<bt:Image size="32" resid="icon32" />
<bt:Image size="80" resid="icon80" />
</Icon>
<Action xsi:type="ExecuteFunction">
<FunctionName>showspecialModal</FunctionName>
</Action>
</Control>
</Group>
</OfficeTab>
</ExtensionPoint>
<ExtensionPoint xsi:type="MessageComposeCommandSurface">
<!-- Use the default tab of the ExtensionPoint or create your own with <CustomTab id="myTab"> -->
<OfficeTab id="TabDefault2">
<!-- Up to 6 Groups added per Tab -->
<Group id="msgReadGroup2">
<Label resid="groupLabel" />
<!-- Launch the add-in : task pane button -->
<Control xsi:type="Button" id="msgReadOpenPaneButton2">
<Label resid="paneReadButtonLabel" />
<Supertip>
<Title resid="paneReadSuperTipTitle" />
<Description resid="paneReadSuperTipDescription" />
</Supertip>
<Icon>
<bt:Image size="16" resid="icon16" />
<bt:Image size="32" resid="icon32" />
<bt:Image size="80" resid="icon80" />
</Icon>
<Action xsi:type="ExecuteFunction">
<FunctionName>showspecialModal</FunctionName>
</Action>
</Control>
</Group>
</OfficeTab>
</ExtensionPoint>
<!-- Go to http://aka.ms/ExtensionPointsCommands to learn how to add more Extension Points: MessageRead, AppointmentOrganizer, AppointmentAttendee -->
</DesktopFormFactor>
</Host>
</Hosts>
<Resources>
<bt:Images>
<bt:Image id="icon16" DefaultValue="https://localhost:44300/Images/app-16.png" />
<bt:Image id="icon32" DefaultValue="https://localhost:44300/Images/app-32.png" />
<bt:Image id="icon80" DefaultValue="https://localhost:44300/Images/app-80.png" />
</bt:Images>
<bt:Urls>
<bt:Url id="fnFile" DefaultValue="https://localhost:44300/functions.html" />
<bt:Url id="messageReadTaskPaneUrl" DefaultValue="https://localhost:44300/task-pane.html" />
</bt:Urls>
<bt:ShortStrings>
<bt:String id="groupLabel" DefaultValue="Red Planet" />
<bt:String id="customTabLabel" DefaultValue="Red Planet Tab" />
<bt:String id="paneReadButtonLabel" DefaultValue="special Reply" />
<bt:String id="paneReadSuperTipTitle" DefaultValue="Get all properties" />
<bt:String id="groupLabel2" DefaultValue="Red Planet2" />
<bt:String id="customTabLabel2" DefaultValue="Red Planet Tab2" />
<bt:String id="paneReadButtonLabel2" DefaultValue="special Reply2" />
<bt:String id="paneReadSuperTipTitle2" DefaultValue="Get all properties2" />
</bt:ShortStrings>
<bt:LongStrings>
<bt:String id="paneReadSuperTipDescription" DefaultValue="Open up the special send dialog." />
<bt:String id="paneReadSuperTipDescription2" DefaultValue="Open up the special send dialog." />
</bt:LongStrings>
</Resources>
<VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.1" xsi:type="VersionOverridesV1_1">
<Requirements>
<bt:Sets DefaultMinVersion="1.5">
<bt:Set Name="Mailbox" />
</bt:Sets>
</Requirements>
<Hosts>
<Host xsi:type="MailHost">
<DesktopFormFactor>
<!-- Location of the Functions that UI-less buttons can trigger (ExecuteFunction Actions). -->
<FunctionFile resid="fnFile" />
<!-- Message Read -->
<ExtensionPoint xsi:type="MessageReadCommandSurface">
<!-- Use the default tab of the ExtensionPoint or create your own with <CustomTab id="myTab"> -->
<OfficeTab id="TabDefault">
<!-- Up to 6 Groups added per Tab -->
<Group id="msgReadGroup">
<Label resid="groupLabel" />
<!-- Launch the add-in : task pane button -->
<Control xsi:type="Button" id="msgReadOpenPaneButton">
<Label resid="paneReadButtonLabel" />
<Supertip>
<Title resid="paneReadSuperTipTitle" />
<Description resid="paneReadSuperTipDescription" />
</Supertip>
<Icon>
<bt:Image size="16" resid="icon16" />
<bt:Image size="32" resid="icon32" />
<bt:Image size="80" resid="icon80" />
</Icon>
<Action xsi:type="ExecuteFunction">
<FunctionName>showspecialModal</FunctionName>
</Action>
</Control>
</Group>
</OfficeTab>
</ExtensionPoint>
<ExtensionPoint xsi:type="MessageComposeCommandSurface">
<!-- Use the default tab of the ExtensionPoint or create your own with <CustomTab id="myTab"> -->
<OfficeTab id="TabDefault2">
<!-- Up to 6 Groups added per Tab -->
<Group id="msgReadGroup2">
<Label resid="groupLabel" />
<!-- Launch the add-in : task pane button -->
<Control xsi:type="Button" id="msgReadOpenPaneButton2">
<Label resid="paneReadButtonLabel" />
<Supertip>
<Title resid="paneReadSuperTipTitle" />
<Description resid="paneReadSuperTipDescription" />
</Supertip>
<Icon>
<bt:Image size="16" resid="icon16" />
<bt:Image size="32" resid="icon32" />
<bt:Image size="80" resid="icon80" />
</Icon>
<Action xsi:type="ExecuteFunction">
<FunctionName>showspecialModal</FunctionName>
</Action>
</Control>
</Group>
</OfficeTab>
</ExtensionPoint>
<!-- Go to http://aka.ms/ExtensionPointsCommands to learn how to add more Extension Points: MessageRead, AppointmentOrganizer, AppointmentAttendee -->
</DesktopFormFactor>
<MobileFormFactor>
<FunctionFile resid="fnFile" />
<ExtensionPoint xsi:type="MobileMessageReadCommandSurface">
<Group id="mobileGroupID">
<Label resid="residAppName" />
<Control xsi:type="MobileButton" id="TaskPaneBtn">
<Label resid="residTaskPaneButtonName" />
<Icon xsi:type="bt:MobileIconList">
<bt:Image size="25" scale="1" resid="icon16" />
<bt:Image size="25" scale="2" resid="icon16" />
<bt:Image size="25" scale="3" resid="icon16" />
<bt:Image size="32" scale="1" resid="icon16" />
<bt:Image size="32" scale="2" resid="icon16" />
<bt:Image size="32" scale="3" resid="icon16" />
<bt:Image size="48" scale="1" resid="icon16" />
<bt:Image size="48" scale="2" resid="icon16" />
<bt:Image size="48" scale="3" resid="icon16" />
</Icon>
<Action xsi:type="ShowTaskpane">
<SourceLocation resid="messageReadTaskPaneUrl" />
</Action>
</Control>
</Group>
</ExtensionPoint>
</MobileFormFactor>
</Host>
</Hosts>
<Resources>
<bt:Images>
<bt:Image id="icon16" DefaultValue="https://localhost:44300/Images/app-16.png" />
<bt:Image id="icon32" DefaultValue="https://localhost:44300/Images/app-32.png" />
<bt:Image id="icon80" DefaultValue="https://localhost:44300/Images/app-80.png" />
</bt:Images>
<bt:Urls>
<bt:Url id="fnFile" DefaultValue="https://localhost:44300/functions.html" />
<bt:Url id="messageReadTaskPaneUrl" DefaultValue="https://localhost:44300/task-pane.html" />
</bt:Urls>
<bt:ShortStrings>
<bt:String id="groupLabel" DefaultValue="Red Planet" />
<bt:String id="customTabLabel" DefaultValue="Red Planet Tab" />
<bt:String id="paneReadButtonLabel" DefaultValue="special Reply" />
<bt:String id="paneReadSuperTipTitle" DefaultValue="Get all properties" />
<bt:String id="groupLabel2" DefaultValue="Red Planet2" />
<bt:String id="customTabLabel2" DefaultValue="Red Planet Tab2" />
<bt:String id="paneReadButtonLabel2" DefaultValue="special Reply2" />
<bt:String id="paneReadSuperTipTitle2" DefaultValue="Get all properties2" />
<bt:String id="residTaskPaneButtonName" DefaultValue="Mobile test" />
<bt:String id="residAppName" DefaultValue="Mobile Testing" />
<bt:String id="residTaskpaneUrl" DefaultValue="Mobile test2" />
</bt:ShortStrings>
<bt:LongStrings>
<bt:String id="paneReadSuperTipDescription" DefaultValue="Open up the special send dialog." />
<bt:String id="paneReadSuperTipDescription2" DefaultValue="Open up the special send dialog." />
</bt:LongStrings>
</Resources>
</VersionOverrides>
</VersionOverrides>
</OfficeApp>
推荐阅读
- angularjs - 安装离子应用程序脚本后,突然从节点模块中删除“@angular 文件夹”
- reactjs - React - Jest - Enzyme:如何模拟 ref 属性
- python - 山蟒的 3D 曲面图
- c++ - 用向量和迭代器 C++ 实现的通用快速排序
- unit-testing - 无法绑定到“routerDirection”,因为它不是“div”的已知属性
- javascript - 从自然节点的 wordnet 中获取同义词数组 - NodeJS
- r - R - 过滤行和求和
- c# - IEnumerable如何将项目添加到列表
- if-statement - VHDL 中的 if 语句:嵌套与多个条件
- android - 找不到属性 app:useSimpleSummaryProvider