Search code examples
javascriptexcelmanifestadd-inadd-on

Excel add-on, manifest, shared JavaScript runtime, can`t define <Runtimes> element


We are developing an Excel add-on and trying to make it 'working long'. Now it starts to work when its tab is opened, but we would like to run it when the document is loaded and then keep add-on working. As I understood, this approach can help: https://learn.microsoft.com/en-us/office/dev/add-ins/develop/configure-your-add-in-to-use-a-shared-runtime

bu when I start to define the manifest:

...
<Hosts>
      <Host xsi:type="Workbook">
        <Runtimes>
          <Runtime resid="KI.Taskpane.UrlMain" lifetime="long" />
        </Runtimes>
        
        <DesktopFormFactor>
        ...

and then 'publish' the manifest - MS VS 2017 reports the error:

The element 'Host' in namespace 'http://schemas.microsoft.com/office/taskpaneappversionoverrides' has invalid child element 'Runtimes' in namespace 'http://schemas.microsoft.com/office/taskpaneappversionoverrides'.

List of possible elements expected: 'DesktopFormFactor' in namespace 'http://schemas.microsoft.com/office/taskpaneappversionoverrides'.

What can I do to fix it? thanks for suggestions.

PS: here is MS Doc about 'runtimes' https://learn.microsoft.com/ru-ru/office/dev/add-ins/reference/manifest/runtimes


Solution

  • seems my VS template was too old or kind of. here is a solution found (yet committed file requires small XML fixes)

    https://github.com/OfficeDev/office-js-docs-pr/issues/2392