OfficeDev / office-js

A repo and NPM package for Office.js, corresponding to a copy of what gets published to the official "evergreen" Office.js CDN, at https://appsforoffice.microsoft.com/lib/1/hosted/office.js.
https://learn.microsoft.com/javascript/api/overview
Other
690 stars 95 forks source link

The element 'Host' in namespace 'http://schemas.microsoft.com/office/mailappversionoverrides/1.1' has invalid child element 'Runtimes' in namespace 'http://schemas.microsoft.com/office/mailappversionoverrides/1.1' #2529

Closed Nikolay-Uvarov closed 8 months ago

Nikolay-Uvarov commented 2 years ago

Message from office-js bot: We’re closing this issue because it has been inactive for a long time. We’re doing this to keep the issues list manageable and useful for everyone. If this issue is still relevant for you, please create a new issue. Thank you for your understanding and continued feedback.

Hi,

I tried to configure my Outlook add-in for event-based activation. I went step by step and got the following error:

The element 'Host' in namespace 'http://schemas.microsoft.com/office/mailappversionoverrides/1.1' has invalid child element 'Runtimes' in namespace 'http://schemas.microsoft.com/office/mailappversionoverrides/1.1'. List of possible elements expected: 'DesktopFormFactor, MobileFormFactor' in namespace 'http://schemas.microsoft.com/office/mailappversionoverrides/1.1'.

I found Runtimes node only in http://schemas.microsoft.com/office/taskpaneappversionoverrides schema.

Could you help me or this page is not correct? https://docs.microsoft.com/en-us/office/dev/add-ins/outlook/autolaunch

Also when I deleted the runtimes section I got the following on the line <ExtensionPoint xsi:type="LaunchEvent">:

This is an invalid xsi:type 'http://schemas.microsoft.com/office/mailappversionoverrides/1.1:LaunchEvent'.

Thanks in advance!


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

AlexJerabek commented 2 years ago

Thanks for reporting this @Nikolay-Uvarov.

@ElizabethSamuel-MSFT, could you please take a look?

ElizabethSamuel-MSFT commented 2 years ago

@Nikolay-Uvarov Can you share some info about your setup? Thanks.

Your Environment

Nikolay-Uvarov commented 2 years ago

@ElizabethSamuel-MSFT Platform [PC desktop, Mac, iOS, Office on the web]: PC desktop Host [Excel, Word, PowerPoint, etc.]: Outlook Office version number: 2016 Operating System: Windows 10 Browser (if using Office on the web): Chrome

ElizabethSamuel-MSFT commented 2 years ago

@Nikolay-Uvarov Thanks for the info. Can you also share the Outlook version and build numbers?

These instructions should help if you're not already familiar with the steps.

Follow these steps to find out which version of Outlook is installed on your computer.

  • In Outlook, choose File. Select Office Account.
  • If you don't see Office Account, option, choose Help.
  • You'll see the product version on the right side of the page.
  • You'll find your version and build number under Product Information.

Thanks.

Nikolay-Uvarov commented 2 years ago

@ElizabethSamuel-MSFT Thanks! Version: 16.0.4498.1000

I got those errors in Visual Studio 2022. I can not build the project. Does the office version affect VS 2022?

Screenshot from VS: image

Nikolay-Uvarov commented 2 years ago

Manifest:

<?xml version="1.0" encoding="UTF-8"?>
<!--Created:ce44715c-8c4e-446b-879c-ea9ebe0f09c8-->
<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">
  <!-- 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>5fbf604e-2d52-4f3d-8ca4-ac3ce411f0ea</Id>
  <!--Version. Updates from the store only get triggered if there is a version change. -->
  <Version>1.0.0.0</Version>
  <ProviderName>[Provider name]</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="OutlookWebAddIn1"/>
  <Description DefaultValue="OutlookWebAddIn1"/>
  <IconUrl DefaultValue="~remoteAppUrl/Images/icon64.png"/>
  <SupportUrl DefaultValue="http://www.contoso.com"/>
  <!-- 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>AppDomain1</AppDomain>
    <AppDomain>AppDomain2</AppDomain>
    <AppDomain>AppDomain3</AppDomain>
  </AppDomains>
  <!--End Basic Settings. -->
  <Hosts>
    <Host Name="Mailbox"/>
  </Hosts>
  <Requirements>
    <Sets>
      <Set Name="Mailbox" MinVersion="1.3"/>
    </Sets>
  </Requirements>
  <FormSettings>
    <Form xsi:type="ItemRead">
      <DesktopSettings>
        <SourceLocation DefaultValue="~remoteAppUrl/MessageRead.html"/>
        <RequestedHeight>250</RequestedHeight>
      </DesktopSettings>
    </Form>
  </FormSettings>
  <Permissions>ReadWriteItem</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">
    <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">
          <!-- Event-based activation happens in a lightweight runtime.-->
          <Runtimes>
            <!-- HTML file including reference to or inline JavaScript event handlers.
              This is used by Outlook on the web and Outlook on the new Mac UI preview. -->
            <Runtime resid="WebViewRuntime.Url">
              <!-- JavaScript file containing event handlers. This is used by Outlook Desktop. -->
              <Override type="javascript" resid="JSRuntime.Url"/>
            </Runtime>
          </Runtimes>
          <DesktopFormFactor>
            <FunctionFile resid="Commands.Url"/>
            <ExtensionPoint xsi:type="MessageReadCommandSurface">
              <OfficeTab id="TabDefault">
                <Group id="msgReadGroup">
                  <Label resid="GroupLabel"/>
                  <Control xsi:type="Button" id="msgReadOpenPaneButton">
                    <Label resid="TaskpaneButton.Label"/>
                    <Supertip>
                      <Title resid="TaskpaneButton.Label"/>
                      <Description resid="TaskpaneButton.Tooltip"/>
                    </Supertip>
                    <Icon>
                      <bt:Image size="16" resid="Icon16"/>
                      <bt:Image size="32" resid="icon32"/>
                      <bt:Image size="80" resid="icon80"/>
                    </Icon>
                    <Action xsi:type="ShowTaskpane">
                      <SourceLocation resid="Taskpane.Url"/>
                    </Action>
                  </Control>
                  <Control xsi:type="Button" id="ActionButton">
                    <Label resid="ActionButton.Label"/>
                    <Supertip>
                      <Title resid="ActionButton.Label"/>
                      <Description resid="ActionButton.Tooltip"/>
                    </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>action</FunctionName>
                    </Action>
                  </Control>
                </Group>
              </OfficeTab>
            </ExtensionPoint>
            <!-- Can configure other command surface extension points for add-in command support. -->
            <!-- Enable launching the add-in on the included events. -->
            <ExtensionPoint xsi:type="LaunchEvent">
              <LaunchEvents>
                <LaunchEvent Type="OnNewMessageCompose" FunctionName="onMessageComposeHandler"/>
                <LaunchEvent Type="OnNewAppointmentOrganizer" FunctionName="onAppointmentComposeHandler"/>
                <LaunchEvent Type="OnMessageAttachmentsChanged" FunctionName="onMessageAttachmentsChangedHandler"/>
                <LaunchEvent Type="OnAppointmentAttachmentsChanged" FunctionName="onAppointmentAttachmentsChangedHandler"/>
                <LaunchEvent Type="OnMessageRecipientsChanged" FunctionName="onMessageRecipientsChangedHandler"/>
                <LaunchEvent Type="OnAppointmentAttendeesChanged" FunctionName="onAppointmentAttendeesChangedHandler"/>
                <LaunchEvent Type="OnAppointmentTimeChanged" FunctionName="onAppointmentTimeChangedHandler"/>
                <LaunchEvent Type="OnAppointmentRecurrenceChanged" FunctionName="onAppointmentRecurrenceChangedHandler"/>
                <LaunchEvent Type="OnInfoBarDismissClicked" FunctionName="onInfobarDismissClickedHandler"/>
                <LaunchEvent Type="OnMessageSend" FunctionName="onMessageSendHandler" SendMode="PromptUser"/>
                <LaunchEvent Type="OnAppointmentSend" FunctionName="onAppointmentSendHandler" SendMode="PromptUser"/>
              </LaunchEvents>
              <!-- Identifies the runtime to be used (also referenced by the Runtime element). -->
              <SourceLocation resid="WebViewRuntime.Url"/>
            </ExtensionPoint>
          </DesktopFormFactor>
        </Host>
      </Hosts>
      <Resources>
        <bt:Images>
          <bt:Image id="icon16" DefaultValue="~remoteAppUrl/Images/icon16.png"/>
          <bt:Image id="icon32" DefaultValue="~remoteAppUrl/Images/icon32.png"/>
          <bt:Image id="icon80" DefaultValue="~remoteAppUrl/Images/icon80.png"/>
        </bt:Images>
        <bt:Urls>
          <bt:Url id="Commands.Url" DefaultValue="~remoteAppUrl/commands/commands.html"/>
          <bt:Url id="Taskpane.Url" DefaultValue="~remoteAppUrl/MessageRead.html"/>
          <bt:Url id="WebViewRuntime.Url" DefaultValue="~remoteAppUrl/commands/commands.html"/>
          <!-- Entry needed for Outlook Desktop. -->
          <bt:Url id="JSRuntime.Url" DefaultValue="~remoteAppUrl/commands/commands.js"/>
        </bt:Urls>
        <bt:ShortStrings>
          <bt:String id="GroupLabel" DefaultValue="Contoso Add-in"/>
          <bt:String id="TaskpaneButton.Label" DefaultValue="Show Taskpane"/>
          <bt:String id="ActionButton.Label" DefaultValue="Perform an action"/>
        </bt:ShortStrings>
        <bt:LongStrings>
          <bt:String id="TaskpaneButton.Tooltip" DefaultValue="Opens a pane displaying all available properties."/>
          <bt:String id="ActionButton.Tooltip" DefaultValue="Perform an action when clicked."/>
        </bt:LongStrings>
      </Resources>
    </VersionOverrides>
  </VersionOverrides>
</OfficeApp>
ElizabethSamuel-MSFT commented 2 years ago

@Nikolay-Uvarov Thanks for providing this information. We're investigating.

Thanks.

ElizabethSamuel-MSFT commented 2 years ago

@Nikolay-Uvarov It seems like the XSD files are out-of-date. The instructions for how to update the ones you need can be found in the troubleshooting guide. Can you try that out and see if it helps?

Also note that the instructions in the event-based activation walkthrough were meant to be used out of the box with the Yeoman generator (yo office) version of the quick start. For Visual Studio, you'd need to create your own command files and such.

Thanks.

Nikolay-Uvarov commented 2 years ago

@ElizabethSamuel-MSFT I updated MailAppVersionOverridesV1_1 and OfficeAppManifestV1_1 files but it did not help me. I still have the same error. As I said I could not find 'Runtimes' child for 'Host' node in the http://schemas.microsoft.com/office/mailappversionoverrides/1.1 schema link. I am going to try Yeoman generator (yo office) version of the quick start.

Thanks

Nikolay-Uvarov commented 2 years ago

I tried to use Yeoman generator (yo office) version of the quick start and it seems to be working.

Does event-based activation work for Outlook 2016? Maybe I did something wrong but it doesn't work in Outlook 2016. It does in Web.

Thanks!

ElizabethSamuel-MSFT commented 2 years ago

@Nikolay-Uvarov Glad to hear that the yo office version worked for you. Office 2016 (one-time purchase) only supports up to 1.4. The supported Outlook clients are noted in this article.

I'll continue investigating the VS situation and let you know.

Thanks.

ElizabethSamuel-MSFT commented 2 years ago

@Nikolay-Uvarov We're working on getting the Mail 1.1 XSD updated to include Runtimes and related elements. Thanks again for letting us know about this issue.

Thanks.

Nikolay-Uvarov commented 2 years ago

@ElizabethSamuel-MSFT Thank you!

Do you know when Android and IOS devices will support the newest version of API requirement set? Or where I can find this roadmap?

ElizabethSamuel-MSFT commented 2 years ago

@Nikolay-Uvarov We don't currently have a roadmap. As additional requirement sets are supported, we usually update documentation like the requirement sets page and the availability page, and we try to tweet about it under handles like @Microsoft365Dev (Microsoft 365 Developer).

ElizabethSamuel-MSFT commented 2 years ago

Transferring to product repo for resolution