SOLVED

Error creating MSIX Package

Brass Contributor

Hello, trying to create my first MSIX package and right away I stumble upon an issue, here is what the log says:

 

[5-8-2020 15:17:43] [Debug] Processing "%UserProfile%\AppData\Local\Packages\Microsoft.MsixPackagingTool_8wekyb3d8bbwe\LocalState\DiagOutputDir\Logs_6\pwqsoyzn.40m.UserClassesRegistryHive" as a payload file.  Its path in the package will be "UserClasses.dat".
[5-8-2020 15:17:43] [Debug] MakeAppx : error: Failure at packageWriter2->Close( manifestStream, contentGroupMapStream.Get()) - 0x80080204 - The specified package format is not valid: The package manifest is not valid.
[5-8-2020 15:17:43] [Debug] MakeAppx : error: Error info: /*[local-name()="Package" and namespace-uri()="http://schemas.microsoft.com/appx/manifest/foundation/windows10"]/*[local-name()="Extensions" and namespace-uri()="http://schemas.microsoft.com/appx/manifest/foundation/windows10"][1]/*[local-name()="Extension" and namespace-uri()="http://schemas.microsoft.com/appx/manifest/com/windows10"][1]/*[local-name()="ComInterface" and namespace-uri()="http://schemas.microsoft.com/appx/manifest/com/windows10"][1]/*[local-name()="TypeLib" and namespace-uri()="http://schemas.microsoft.com/appx/manifest/com/windows10"][1001]
[5-8-2020 15:17:43] [Debug] Inhoud van element '{http://schemas.microsoft.com/appx/manifest/com/windows10}TypeLib' is onverwacht volgens inhoudmodel van bovenliggend element '{http://schemas.microsoft.com/appx/manifest/com/windows10}ComInterface'.
[5-8-2020 15:17:43] [Debug] Cleaning up output file "\\?\%UserProfile%\Desktop\EG2003E_1.0.0.0_x64__dyg2y5qz6y7ec.msix".
[5-8-2020 15:17:43] [Debug] MakeAppx : error: Failure at (CreatePackage( overwrite, hashAlgorithm, fileList, outputPath, manifestStream.Get(), forceCompressionNone, performanceOptions, encryptPackage, encryptionOptions, cgmPath, mainPackagePathForResourceExemption, makepriExeFullPath)) - 0x80080204 - The specified package format is not valid: The package manifest is not valid.
[5-8-2020 15:17:43] [Debug] MakeAppx : error: Package creation failed.
[5-8-2020 15:17:43] [Debug] MakeAppx : error: 0x80080204 - The specified package format is not valid: The package manifest is not valid.
[5-8-2020 15:17:43] [Error] MakeAppx.exe failed, exit code = 1
[5-8-2020 15:17:43] [Error] Error Finalizing Package: Process MakeAppx.exe failed with exit code 1.
[5-8-2020 15:17:43] [Debug] No access token file exists.
[5-8-2020 15:17:43] [Warning] Error Occurred: Microsoft.Packaging.SDKUtils.ProcessRunner.ProcessRunnerException: Process MakeAppx.exe failed with exit code 1.

 

Also, when I edit the package details and edit the manifest file, without changing anything it tells me this:

Unable to parse manifest. Edit the manifest file to fix errors.
/*[local-name()="Package" and namespace-uri()="http://schemas.microsoft.com/appx/manifest/foundation/windows10"]/*[local-name()="Extensions" and namespace-uri()="http://schemas.microsoft.com/appx/manifest/foundation/windows10"][1]/*[local-name()="Extension" and namespace-uri()="http://schemas.microsoft.com/appx/manifest/com/windows10"][1]/*[local-name()="ComInterface" and namespace-uri()="http://schemas.microsoft.com/appx/manifest/com/windows10"][1]/*[local-name()="TypeLib" and namespace-uri()="http://schemas.microsoft.com/appx/manifest/com/windows10"][1001]
Inhoud van element '{http://schemas.microsoft.com/appx/manifest/com/windows10}TypeLib' is onverwacht volgens inhoudmodel van bovenliggend element '{http://schemas.microsoft.com/appx/manifest/com/windows10}ComInterface'.

 Any idea how to fix?


Thanks!

2 Replies
best response confirmed by martijnk79 (Brass Contributor)
Solution

@martijnk79 

The error says that the 1001s TypeLib element of ComInterface is invalid.

/*[local-name()="ComInterface" and namespace-uri()="http://schemas.microsoft.com/appx/manifest/com/windows10"][1]
/*[local-name()="TypeLib" and namespace-uri()="http://schemas.microsoft.com/appx/manifest/com/windows10"][1001]

That is because ComInterface can only hold up to 1000 TypeLib elements.

 

To work around this, you can manually edit the manifest to split the TypeLib elements across multiple ComInterface elements without exceeding 1000 on any of them. Something like this:

    <com:Extension Category="windows.comInterface">
      <com:ComInterface>
        <com:TypeLib Id="7a341bcb-a9eb-4bd6-ae98-610545b6bad6">...</com:TypeLib>
        ...
        <com:TypeLib Id="4feb5d08-4ba4-432b-9684-9bd4e25be16d">...</com:TypeLib>
      </com:ComInterface>
    </com:Extension>
    <com:Extension Category="windows.comInterface">
      <com:ComInterface>
        <com:TypeLib Id="d6ead1ce-d822-47b8-9db6-7c5c491ebb7b">...</com:TypeLib>
        ...
        <com:TypeLib Id="39728c88-4324-4a52-b7d6-3f23abafba06">...</com:TypeLib>
      </com:ComInterface>
    </com:Extension>

 

Thank you for letting us know of this issue. We will update the packaging tool to prevent this error in future releases.

@Chacon Thanks for that!

1 best response

Accepted Solutions
best response confirmed by martijnk79 (Brass Contributor)
Solution

@martijnk79 

The error says that the 1001s TypeLib element of ComInterface is invalid.

/*[local-name()="ComInterface" and namespace-uri()="http://schemas.microsoft.com/appx/manifest/com/windows10"][1]
/*[local-name()="TypeLib" and namespace-uri()="http://schemas.microsoft.com/appx/manifest/com/windows10"][1001]

That is because ComInterface can only hold up to 1000 TypeLib elements.

 

To work around this, you can manually edit the manifest to split the TypeLib elements across multiple ComInterface elements without exceeding 1000 on any of them. Something like this:

    <com:Extension Category="windows.comInterface">
      <com:ComInterface>
        <com:TypeLib Id="7a341bcb-a9eb-4bd6-ae98-610545b6bad6">...</com:TypeLib>
        ...
        <com:TypeLib Id="4feb5d08-4ba4-432b-9684-9bd4e25be16d">...</com:TypeLib>
      </com:ComInterface>
    </com:Extension>
    <com:Extension Category="windows.comInterface">
      <com:ComInterface>
        <com:TypeLib Id="d6ead1ce-d822-47b8-9db6-7c5c491ebb7b">...</com:TypeLib>
        ...
        <com:TypeLib Id="39728c88-4324-4a52-b7d6-3f23abafba06">...</com:TypeLib>
      </com:ComInterface>
    </com:Extension>

 

Thank you for letting us know of this issue. We will update the packaging tool to prevent this error in future releases.

View solution in original post