Support for Com4 ManagedInProcessServer and others
Com servers may generally be written in managed or unmanaged code. The COM4 schema extensions include elements such as com4:ManagedInProcessServer which allows for the specification of a COM Clsid that is implemented in managed code.
Unfortunately, the foundation manifest was not extended to include these new categories when performing the uniqueness test to ensure that when other element references a CLSID that the ID is defined once and only once in the document. This was done when COM2 was added to the schema set but seems to have been missed here.
These are the lines from the latest SDK version of the FoundationManifestSchema.xsd (starting on line 134) which appear problematic to me:
<xs:unique name=”Class_Id”>
<xs:selector xpath=”f:Applications/f:Application/f:Extensions/com:Extension/com:ComServer/com:ExeServer/com:Class | f:Applications/f:Application/f:Extensions/com:Extension/com:ComServer/com:SurrogateServer/com:Class | f:Applications/f:Application/f:Extensions/com:Extension/com:ComServer/com:TreatAsClass | f:Applications/f:Application/f:Extensions/com:Extension/com:ComInterface/com:ProxyStub | f:Extensions/com:Extension/com:ComInterface/com:ProxyStub | f:Applications/f:Application/f:Extensions/com2:Extension/com2:ComServer/com:ExeServer/com:Class | f:Applications/f:Application/f:Extensions/com2:Extension/com2:ComServer/com:SurrogateServer/com:Class | f:Applications/f:Application/f:Extensions/com2:Extension/com2:ComServer/com:TreatAsClass | f:Applications/f:Application/f:Extensions/com2:Extension/com2:ComInterface/com:ProxyStub | f:Extensions/com2:Extension/com2:ComInterface/com:ProxyStub”/>
<xs:field xpath=”@Id”/>
</xs:unique>
This means that while we are able to add the ManagedInProcessServer element to define the com server component (as either a PackageExtension or ApplicationExtension as needed), we cannot reference the Clsid in any other element that would need it, such as a ShellExtension.
Fixing the above in the Foundation (and updating all tooling that verifying the schemas) will be necessary in order to build and package up more modern COM components.
Tagging @Fizza for visibility.
Com servers may generally be written in managed or unmanaged code. The COM4 schema extensions include elements such as com4:ManagedInProcessServer which allows for the specification of a COM Clsid that is implemented in managed code.
Unfortunately, the foundation manifest was not extended to include these new categories when performing the uniqueness test to ensure that when other element references a CLSID that the ID is defined once and only once in the document. This was done when COM2 was added to the schema set but seems to have been missed here.
These are the lines from the latest SDK version of the FoundationManifestSchema.xsd (starting on line 134) which appear problematic to me:
<xs:unique name=”Class_Id”><xs:selector xpath=”f:Applications/f:Application/f:Extensions/com:Extension/com:ComServer/com:ExeServer/com:Class | f:Applications/f:Application/f:Extensions/com:Extension/com:ComServer/com:SurrogateServer/com:Class | f:Applications/f:Application/f:Extensions/com:Extension/com:ComServer/com:TreatAsClass | f:Applications/f:Application/f:Extensions/com:Extension/com:ComInterface/com:ProxyStub | f:Extensions/com:Extension/com:ComInterface/com:ProxyStub | f:Applications/f:Application/f:Extensions/com2:Extension/com2:ComServer/com:ExeServer/com:Class | f:Applications/f:Application/f:Extensions/com2:Extension/com2:ComServer/com:SurrogateServer/com:Class | f:Applications/f:Application/f:Extensions/com2:Extension/com2:ComServer/com:TreatAsClass | f:Applications/f:Application/f:Extensions/com2:Extension/com2:ComInterface/com:ProxyStub | f:Extensions/com2:Extension/com2:ComInterface/com:ProxyStub”/><xs:field xpath=”@Id”/></xs:unique>
This means that while we are able to add the ManagedInProcessServer element to define the com server component (as either a PackageExtension or ApplicationExtension as needed), we cannot reference the Clsid in any other element that would need it, such as a ShellExtension.
Fixing the above in the Foundation (and updating all tooling that verifying the schemas) will be necessary in order to build and package up more modern COM components.
Tagging @Fizza for visibility. Read More