<SupportsSharedFolders> 未包含在 Visual Studio 2017 中MailAppVersionOverridesV1_1的架构定义中?



在Visual Studio 2017中构建Office外接程序清单项目时,架构定义不包括SupportsSharedFolders元素时出错。但是,文档指出1.8中支持此元素:https://learn.microsoft.com/en-us/office/dev/add-ins/reference/manifest/supportssharedfolders

error : The element 'DesktopFormFactor' in namespace 'http://schemas.microsoft.com/office/mailappversionoverrides/1.1' has invalid child element 'SupportsSharedFolders' in namespace 'http://schemas.microsoft.com/office/mailappversionoverrides/1.1'. List of possible elements expected: 'FunctionFile, ExtensionPoint' in namespace 'http://schemas.microsoft.com/office/mailappversionoverrides/1.1'.

以下是一个示例清单,它可以侧加载到包含以下元素的Office 365邮箱中:

<!--Published:70EDFC97-B41D-43C5-B751-7C00AD999804-->
<!--Created:cb85b80c-f585-40ff-8bfc-12ff4d0e34a9-->
<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:mailappor="http://schemas.microsoft.com/office/mailappversionoverrides/1.0"
xsi:type="MailApp">
<Id>e6497c92-80b1-47c6-b983-28bb81fde0ca</Id>
<Version>1.0.0</Version>
<ProviderName>Example</ProviderName>
<DefaultLocale>en-US</DefaultLocale>
<DisplayName DefaultValue="Test Add-in" />
<Description DefaultValue="An example add-in" />
<IconUrl DefaultValue="https://localhost/icon.png" />
<HighResolutionIconUrl DefaultValue="https://localhost/icon.png" />
<SupportUrl DefaultValue="https://example.com" />
<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/index.html" />
<RequestedHeight>216</RequestedHeight>
</DesktopSettings>
<TabletSettings>
<SourceLocation DefaultValue="https://localhost/index.html" />
<RequestedHeight>216</RequestedHeight>
</TabletSettings>
<PhoneSettings>
<SourceLocation DefaultValue="https://localhost/index.html" />
</PhoneSettings>
</Form>
</FormSettings>
<Permissions>ReadWriteMailbox</Permissions>
<Rule xsi:type="RuleCollection" Mode="Or">
<Rule xsi:type="ItemIs" ItemType="Message" FormType="Read" />
</Rule>
<DisableEntityHighlighting>false</DisableEntityHighlighting>
<VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides" xsi:type="VersionOverridesV1_0">
<Requirements>
<bt:Sets DefaultMinVersion="1.3">
<bt:Set Name="Mailbox" />
</bt:Sets>
</Requirements>
<Hosts>
<Host xsi:type="MailHost">
<DesktopFormFactor>
<!-- Message compose form -->
<ExtensionPoint xsi:type="MessageReadCommandSurface">
<OfficeTab id="TabDefault">
<Group id="msgComposeGroup">
<Label resid="groupLabel" />
<!-- Task pane button -->
<Control xsi:type="Button" id="msgComposeOpenPaneButton">
<Label resid="paneComposeButtonLabel" />
<Supertip>
<Title resid="paneComposeSuperTipTitle" />
<Description resid="paneComposeSuperTipDescription" />
</Supertip>
<Icon>
<bt:Image size="16" resid="cmd-icon-16" />
<bt:Image size="32" resid="cmd-icon-32" />
<bt:Image size="80" resid="cmd-icon-80" />
</Icon>
<Action xsi:type="ShowTaskpane">
<SourceLocation resid="composeTaskPaneUrl" />
</Action>
</Control>
</Group>
</OfficeTab>
</ExtensionPoint>
</DesktopFormFactor>
</Host>
</Hosts>
<Resources>
<bt:Images>
<bt:Image id="cmd-icon-16" DefaultValue="https://localhost/icon.png" />
<bt:Image id="cmd-icon-32" DefaultValue="https://localhost/icon.png" />
<bt:Image id="cmd-icon-80" DefaultValue="https://localhost/icon.png" />
<bt:Image id="cmd-icon-25" DefaultValue="https://localhost/icon.png" />
<bt:Image id="cmd-icon-48" DefaultValue="https://localhost/icon.png" />
</bt:Images>
<bt:Urls>
<bt:Url id="composeTaskPaneUrl" DefaultValue="https://localhost/index.html" />
</bt:Urls>
<bt:ShortStrings>
<bt:String id="groupLabel" DefaultValue="Example" />
<bt:String id="paneComposeButtonLabel" DefaultValue="Test Add-in" />
<bt:String id="paneComposeSuperTipTitle" DefaultValue="Test Add-in Super Tip" />
</bt:ShortStrings>
<bt:LongStrings>
<bt:String id="paneComposeSuperTipDescription" DefaultValue="A test add-in" />
</bt:LongStrings>
</Resources>
<!-- 1.1 overrides -->
<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">
<DesktopFormFactor>
<SupportsSharedFolders>true</SupportsSharedFolders>
<!-- Message compose form -->
<ExtensionPoint xsi:type="MessageReadCommandSurface">
<OfficeTab id="TabDefault">
<Group id="msgComposeGroup">
<Label resid="groupLabel" />
<!-- Task pane button -->
<Control xsi:type="Button" id="msgComposeOpenPaneButton">
<Label resid="paneComposeButtonLabel" />
<Supertip>
<Title resid="paneComposeSuperTipTitle" />
<Description resid="paneComposeSuperTipDescription" />
</Supertip>
<Icon>
<bt:Image size="16" resid="cmd-icon-16" />
<bt:Image size="32" resid="cmd-icon-32" />
<bt:Image size="80" resid="cmd-icon-80" />
</Icon>
<Action xsi:type="ShowTaskpane">
<SourceLocation resid="composeTaskPaneUrl" />
</Action>
</Control>
</Group>
</OfficeTab>
</ExtensionPoint>
</DesktopFormFactor>
<MobileFormFactor>
<ExtensionPoint xsi:type="MobileMessageReadCommandSurface">
<Group id="mobileGroupID">
<Label resid="paneComposeButtonLabel" />
<Control xsi:type="MobileButton" id="mobileButton1">
<Label resid="paneComposeButtonLabel" />
<Icon xsi:type="bt:MobileIconList">
<bt:Image size="25" scale="1" resid="cmd-icon-25" />
<bt:Image size="25" scale="2" resid="cmd-icon-25" />
<bt:Image size="25" scale="3" resid="cmd-icon-25" />
<bt:Image size="32" scale="1" resid="cmd-icon-32" />
<bt:Image size="32" scale="2" resid="cmd-icon-32" />
<bt:Image size="32" scale="3" resid="cmd-icon-32" />
<bt:Image size="48" scale="1" resid="cmd-icon-48" />
<bt:Image size="48" scale="2" resid="cmd-icon-48" />
<bt:Image size="48" scale="3" resid="cmd-icon-48" />
</Icon>
<Action xsi:type="ShowTaskpane">
<SourceLocation resid="composeTaskPaneUrl" />
</Action>
</Control>
</Group>
</ExtensionPoint>
</MobileFormFactor>
</Host>
</Hosts>
<Resources>
<bt:Images>
<bt:Image id="cmd-icon-16" DefaultValue="https://localhost/icon.png" />
<bt:Image id="cmd-icon-32" DefaultValue="https://localhost/icon.png" />
<bt:Image id="cmd-icon-80" DefaultValue="https://localhost/icon.png" />
<bt:Image id="cmd-icon-25" DefaultValue="https://localhost/icon.png" />
<bt:Image id="cmd-icon-48" DefaultValue="https://localhost/icon.png" />
</bt:Images>
<bt:Urls>
<bt:Url id="composeTaskPaneUrl" DefaultValue="https://localhost/index.html" />
</bt:Urls>
<bt:ShortStrings>
<bt:String id="groupLabel" DefaultValue="Example" />
<bt:String id="paneComposeButtonLabel" DefaultValue="Test Add-in"/>
<bt:String id="paneComposeSuperTipTitle" DefaultValue="Test Add-in Super Tip" />
</bt:ShortStrings>
<bt:LongStrings>
<bt:String id="paneComposeSuperTipDescription" DefaultValue="An example add-in." />
</bt:LongStrings>
</Resources>
</VersionOverrides>
</VersionOverrides>
</OfficeApp>

这似乎是由于Visual Studio 2017中的架构定义已过时,并且未包含此新元素。我能够从Visual Studio 2019安装中提取MailAppVersionOverridesV1_1.xsd架构定义文件("C:\Program Files(x86(\Microsoft Visual Studio\2017\Professional\Xml\Schemas\1033",具体取决于VS的安装(来绕过此问题,但Visual Studio 2017是否会有任何更新来支持此问题?

相关内容

  • 没有找到相关文章

最新更新