Error creating MSIX package

Brass Contributor

Hi, iám trying to create a MSIX package but it fails:

[10/26/2022 12:19:56 PM] [Debug] MakeAppx : error: Failure at packageWriter2->Close( manifestStream, contentGroupMapStream.Get()) - 0x80080204 - The specified package format is not valid: The package manifest is not valid.
[10/26/2022 12:19:56 PM] [Debug] MakeAppx : error: Error info: /*[local-name()="Package" and namespace-uri()="http://schemas.microsoft.com/appx/manifest/foundation/windows10"]/*[local-name()="Applications" and namespace-uri()="http://schemas.microsoft.com/appx/manifest/foundation/windows10"][1]/*[local-name()="Application" and namespace-uri()="http://schemas.microsoft.com/appx/manifest/foundation/windows10"][1]/*[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()="ComServer" and namespace-uri()="http://schemas.microsoft.com/appx/manifest/com/windows10"][1]
[10/26/2022 12:19:56 PM] [Debug] The keyref '02a18d22-0349-4932-9cbb-64bc5c6fe62c' does not resolve to a key for the Identity Constraint '{http://schemas.microsoft.com/appx/manifest/com/windows10}Class_Or_TreatAsClass_IdKey'.
[10/26/2022 12:19:56 PM] [Debug] Cleaning up output file "\\?\%UserProfile%\Desktop\SW01277-01_16.0.1605.21_x64__gs30ax5hs4rre.msix".
[10/26/2022 12:19:56 PM] [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.
[10/26/2022 12:19:56 PM] [Debug] MakeAppx : error: Package creation failed.
[10/26/2022 12:19:56 PM] [Debug] MakeAppx : error: 0x80080204 - The specified package format is not valid: The package manifest is not valid.
[10/26/2022 12:19:56 PM] [Error] MakeAppx.exe failed, exit code = 1
[10/26/2022 12:19:56 PM] [Debug] Finalizing the conversion state
[10/26/2022 12:19:56 PM] [Debug] Getting environment object from %UserProfile%\AppData\Local\Packages\Microsoft.MsixPackagingTool_8wekyb3d8bbwe\LocalState\MsixGenerator.ConversionState.xml
[10/26/2022 12:19:56 PM] [Warning] Error occurred: System.InvalidOperationException: Environment is not set or acquired
   at MsixGenerator.LocalOrRemoteExecution.ExecutionEnvironments.EnvironmentObject.SaveToEnvironment()
   at Microsoft.ApplicationVirtualization.Packaging.ExceptionGuard`1.Guard(Action execute, Action`1 exceptionAction)
[10/26/2022 12:19:56 PM] [Warning] Error Occurred: Microsoft.Msix.Utils.ProcessRunner.ProcessRunnerException: Process MakeAppx.exe failed with exit code 1.
   at Microsoft.Msix.Utils.ProcessRunner.ProcessRunnerBase.ValidateExitCode(Int32[] validCodes)
   at Microsoft.ApplicationVirtualization.Packaging.Packager.FinalizePackageViaMakeAppx(IPackageFiles packageFiles, String manifestPath, String appvManifestPath, String registryHivePath, Boolean useExistingRegisterHive, String userRegistryHivePath, String userClassesRegistryHivePath, String packagePath, String msixMappingPath, CompressionOption compression, MsixPackageInputProperties msixPackageInputProperties, CancellationTokenSource cancellationTokenSource)
   at MsixGenerator.MsixPackageEditor.FinalizePackage(CancellationTokenSource cancellationTokenSource, Boolean modifyExistingPackage)
   at MsixPackagingTool.ViewModel.PackageEditorWorkflow.MasterPackageEditorViewModel.SavePackageEditorChanges_BackgroundWorker(Object sender, DoWorkEventArgs doWorkEventArgs)
   at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)
   at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)
[10/26/2022 12:31:26 PM] [Debug] Spawning background worker thread.
[10/26/2022 12:31:26 PM] [Debug] IgnorableNamespaces attribute value is : uap uap2 uap3 uap10 rescap com
[10/26/2022 12:31:26 PM] [Debug] Adding Capability: runFullTrust
[10/26/2022 12:31:26 PM] [Debug] Translating Packaged Services to Manifest
[10/26/2022 12:31:26 PM] [Debug] IgnorableNamespaces attribute value is : uap uap2 uap3 uap10 rescap com
[10/26/2022 12:31:26 PM] [Debug] File type associated with Manifest: notepad.exe
[10/26/2022 12:32:40 PM] [Debug] Manifest Process Exited.
[10/26/2022 12:32:40 PM] [Debug] Attempting to read and validate the saved manifest file: %UserProfile%\AppData\Local\Packages\Microsoft.MsixPackagingTool_8wekyb3d8bbwe\LocalState\DiagOutputDir\Logs_14\xabayyvi.hex.Manifest 
[10/26/2022 12:32:40 PM] [Error] System.Runtime.InteropServices.COMException (0x80080204): /*[local-name()="Package" and namespace-uri()="http://schemas.microsoft.com/appx/manifest/foundation/windows10"]/*[local-name()="Applications" and namespace-uri()="http://schemas.microsoft.com/appx/manifest/foundation/windows10"][1]/*[local-name()="Application" and namespace-uri()="http://schemas.microsoft.com/appx/manifest/foundation/windows10"][1]/*[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()="ComServer" and namespace-uri()="http://schemas.microsoft.com/appx/manifest/com/windows10"][1]
The keyref '02a18d22-0349-4932-9cbb-64bc5c6fe62c' does not resolve to a key for the Identity Constraint '{http://schemas.microsoft.com/appx/manifest/com/windows10}Class_Or_TreatAsClass_IdKey'.

   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   at Microsoft.ApplicationVirtualization.Packaging.Impl.AppxManifestReader..ctor(String path)
   at Microsoft.ApplicationVirtualization.Packaging.AppxPackageFactory.ReadManifest(String path)
   at MsixGenerator.MsixPackageEditor.ValidateManifestOrThrow(String manifestPath)
   at MsixGenerator.MsixPackageEditor.TryParseManifestFile(String manifestPath)
[10/26/2022 12:32:40 PM] [Warning] Unable to parse manifest. Edit the manifest file to fix errors.
[10/26/2022 12:32:40 PM] [Debug] Returning back to Package Editor view.

 

What does the error below mean?

The keyref '02a18d22-0349-4932-9cbb-64bc5c6fe62c' does not resolve to a key for the Identity Constraint '{http://schemas.microsoft.com/appx/manifest/com/windows10}Class_Or_TreatAsClass_IdKey'.

 

The keyref in the manifest file:

      <Extensions>
        <com:Extension Category="windows.comServer">
          <com:ComServer>
            <com:ExeServer Executable="vfs\programfilesx64\sparx systems\ea\ea.exe">
              <com:Class Id="02A18D22-0349-4932-9CBB-64BC5C6FE62C" DisplayName="EA.PropertiesTab" ProgId="EA.PropertiesTab" EnableOleDefaultHandler="true" />
              <com:Class Id="3A9E4F92-8D27-495B-8B22-1D702B3F0C83" DisplayName="EA.App" ProgId="EA.App" EnableOleDefaultHandler="true" />
              <com:Class Id="67F4E0FA-46A7-4255-B084-69A9433D08C3" DisplayName="EA.Repository" ProgId="EA.Repository" EnableOleDefaultHandler="true" />
              <com:Class Id="8667FE5E-6D96-400A-AF0A-15C29F94DFCD" DisplayName="EA.Project" ProgId="EA.Project" EnableOleDefaultHandler="true" />
            </com:ExeServer>
            <com:ProgId Id="EA.PropertiesTab" Clsid="02a18d22-0349-4932-9cbb-64bc5c6fe62c" />
            <com:ProgId Id="EA.App" Clsid="3a9e4f92-8d27-495b-8b22-1d702b3f0c83" />
            <com:ProgId Id="EA.Repository" Clsid="67f4e0fa-46a7-4255-b084-69a9433d08c3" />
            <com:ProgId Id="EA.Project" Clsid="8667fe5e-6d96-400a-af0a-15c29f94dfcd" />
          </com:ComServer>
        </com:Extension>
2 Replies
Um, I'm not sure that case *should* matter, but maybe make the GUIDs use the same case.

Hi,

Can you share the version of MSIX packaging Tool you are using?

 

Can you use the latest version (v1.2022.1101.0) and see if the issue persists. If you are using the latest version, can you more details like the application name, OS version, etc?

Best
Aniket