Runtime element

Configures your add-in to use a shared JavaScript runtime so that various components all run in the same runtime. Child of the Runtimes element.

Add-in type: Task pane, Mail

Valid only in these VersionOverrides schemas:

  • Task pane 1.0
  • Mail 1.1

For more information, see Version overrides in the add-in only manifest.

Associated with these requirement sets:

Important

For the shared JavaScript runtime, this element enables the ribbon, task pane, and other supported components to use the same runtime. However, the SharedRuntime requirement set is only available in some Office applications. For more information, see Shared runtime requirement sets.

Outlook

Note that the event-based activation and integrated spam reporting features must use the same runtime. Multiple runtimes aren't currently supported in Outlook.

Syntax

<Runtimes>
    <Runtime resid="ContosoAddin.Url" lifetime="long" />
</Runtimes>

Contained in

Child elements

Element Required Description
Override No Outlook: Specifies the URL location of the JavaScript file that Outlook on Windows requires for LaunchEvent extension point and ReportPhishingCommandSurface extension point (preview) handlers. Important: At present, you can only define one <Override> element and it must be of type javascript.

Attributes

Attribute Required Description
resid Yes Specifies the URL location of the HTML page for your add-in. The resid can be no more than 32 characters and must match an id attribute of a Url element in the Resources element.
lifetime No The default value for lifetime is short and doesn't need to be specified. Outlook event-based activation and spam-reporting add-ins use only the short value. If you want to use a shared runtime in an Excel add-in, explicitly set the value to long.

lifetime attribute

Optional. Represents the length of time the add-in is allowed to run.

Available values

short: Default. Used only for Outlook event-based activation and spam-reporting add-ins. After the add-in is activated, it will run for a maximum amount of time as specified by the platform. Currently, that's around 5 minutes. This is the only value supported by Outlook.

long: Used only when configuring a shared JavaScript runtime. The add-in can start on document open and run indefinitely. For example, task pane code will continue running even when the user closes the task pane. This is the only value supported by the shared runtime.

See also