我正在尝试在线遵循几个示例,以将移动任务窗格添加到我的Office加载项应用程序中,但是现在似乎卡在了此错误中。怎么了“安装失败:清单的versionoverrides 1.0 secon无效。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>
答案 0 :(得分:4)
您发布的清单中有几个问题...
DefaultMinVersion
(1.5)部分的VersionOverridesV1_0
不能高于VersionOverridesV1_1
(1.3)中的指定。Url
资源应指向.html
文件,包括FunctionFile
。VersionOverridesV1_1
部分从VersionOverridesV1_0
部分中获取任何内容,您必须在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>
答案 1 :(得分:0)
仅当VersionOverrides的xsi:type属性值为VersionOverridesV1_1时才能指定MobileFormFactor。
您也可以参考this了解更多信息