com4:ComServer

Declares a package extension point of type windows.comServer. The comServer extension may include class registrations, including activation details for the servers that implement these classes, and ProgId and TreatAsClass registrations, which provide additional identifiers used to reference these classes at runtime.

Element Hierarchy

<Package>

    <Applications>

         <Application>

              <Extensions>

                   <com4:Extension>

                        <com4:ComServer>

    <Extensions>

         <com4:Extension>

              <com4:ComServer>

Syntax

<com4:ComServer>

<!-- Child elements -->
  Class{0,1}
  ExeServer{0,1}
  ServiceServer{0,1}
  SurrogateServer{0,1}
  TreatAsClass{0,1}
  ProgId{0,1}
  InProcessServer{0,1}
  InProcessHandler{0,1}
  ManagedInProcessServer{0,1}
  com5:InProcessServer{0,1}
  com5:InProcessHandler{0,1}

</com4:ComServer>

Key

{}   specific range of occurrences

Attributes and elements

Attributes

None.

Child elements

Child element Description
Class Defines a class registration in a COM server.
ExeServer Registers an ExeServer with one or many class registrations.
ServiceServer Registers a ServiceServer with one or many class registrations.
SurrogateServer Registers a SurrogateServer with one or many class registrations.
TreatAsClass A registration that corresponds to a CLSID registration with the TreatAs subkey.
ProgId A programmatic identifier (ProgID) that can be associated with a CLSID.
InProcessServer Registers an in-process server with one or many class registrations.
InProcessHandler Registers an in-process handler with one or many class registrations.
ManagedInProcessServer Registers a managed in-process server with one or many class registrations.
com5:InProcessServer Registers an in-process server with one or many class registrations. The com5 schema introduces some minor changes in syntactic validation from the com4 schema.
com5:InProcessHandler Registers an in-process handler with one or many class registrations. The com5 schema introduces some minor changes in syntactic validation from the com4 schema.

Parent elements

Parent element Description
com4:Extension Provides functionality to expose COM registrations to clients outside of the app package. The com4 extension is a new version that is a superset of and replacement for the previous COM schema versions.

Remarks

In multi-application packages, it's important to place the COM server registration under the correct Applications/Application manifest element, because COM server processes will run with the identity of the ancestor Applications/Application element.

COM servers registered in the manifest always get Activate As Package (AAP) behavior, which means the COM server runs with the user session default token with package and application claims added. This is different from the default activation behavior of classically registered COM servers, in which the COM server runs with the client's token. For most applications, this difference will not be noticeable because clients typically run with the user session default token. Other activation behaviors, such as RunAs, are not supported.

It is possible to have multiple comServer extensions under the Applications/Application element, but in most cases this is neither necessary nor recommended. An example of an edge case where multiple comServer extensions are needed is if a package needs some of the registrations to have CompatMode="classic" while others have CompatMode="modern", the only way to do this is to split them between extensions.

Changes in the com4 extension

The com4 extension syntax is a new, superset of the previous com extension syntax. This version of the syntax supports the same structure as older versions of the syntax, where class registrations are represented by ExeServer/Class, SurrogateServer/Class, ServiceServer/Class, InProcessServer/Class, InProcessHandler/Class, or ManagedInProcessServer/Class elements.

The new syntax also supports alternative structures, where:

  • ExeServer/ClassReference, SurrogateServer/ClassReference, ServiceServer/ClassReference, InProcessServer/ClassReference, InProcessHandler/ClassReference, or ManagedInProcessServer/ClassReference elements reference top-level Class elements

and/or

  • SurrogateServer/InProcessServerClassReference elements reference InProcessServer/Class (alternatively, InProcessServer/ClassReference) or ManagedInProcessServer/Class (alternatively, ManagedInProcessServer/ClassReference) elements.

The main purpose of the new syntax structure is to enable combinations of in-process server, in-process handler, and out of process server registrations for the same CLSID, as is possible and supported with the classic registry layout. For more information on the COM registry layout, see CLSID Key.

Requirements

Item Value
Namespace http://schemas.microsoft.com/appx/manifest/com/windows10/4
Minimum OS Version Windows 10 (Build 20348)