SOLVED

Error creating an MSIX Package

%3CLINGO-SUB%20id%3D%22lingo-sub-2885891%22%20slang%3D%22en-US%22%3EError%20creating%20an%20MSIX%20Package%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2885891%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3EHello%2C%20I'am%20trying%20to%20create%20a%20MSIX%20package%20but%20it%20fails.%20The%20log%20file%3A%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EI%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-csharp%22%3E%3CCODE%3E%5B10%2F26%2F2021%202%3A06%3A34%20PM%5D%20%5BDebug%5D%20MakeAppx%20%3A%20error%3A%20Failure%20at%20packageWriter2-%26gt%3BClose(%20manifestStream%2C%20contentGroupMapStream.Get())%20-%200x80080204%20-%20The%20specified%20package%20format%20is%20not%20valid%3A%20The%20package%20manifest%20is%20not%20valid.%0A%5B10%2F26%2F2021%202%3A06%3A34%20PM%5D%20%5BDebug%5D%20MakeAppx%20%3A%20error%3A%20Error%20info%3A%20%2F*%5Blocal-name()%3D%22Package%22%20and%20namespace-uri()%3D%22http%3A%2F%2Fschemas.microsoft.com%2Fappx%2Fmanifest%2Ffoundation%2Fwindows10%22%5D%2F*%5Blocal-name()%3D%22Extensions%22%20and%20namespace-uri()%3D%22http%3A%2F%2Fschemas.microsoft.com%2Fappx%2Fmanifest%2Ffoundation%2Fwindows10%22%5D%5B1%5D%2F*%5Blocal-name()%3D%22Extension%22%20and%20namespace-uri()%3D%22http%3A%2F%2Fschemas.microsoft.com%2Fappx%2Fmanifest%2Fcom%2Fwindows10%22%5D%5B1%5D%2F*%5Blocal-name()%3D%22ComInterface%22%20and%20namespace-uri()%3D%22http%3A%2F%2Fschemas.microsoft.com%2Fappx%2Fmanifest%2Fcom%2Fwindows10%22%5D%5B1%5D%2F*%5Blocal-name()%3D%22TypeLib%22%20and%20namespace-uri()%3D%22http%3A%2F%2Fschemas.microsoft.com%2Fappx%2Fmanifest%2Fcom%2Fwindows10%22%5D%5B9%5D%2F*%5Blocal-name()%3D%22Version%22%20and%20namespace-uri()%3D%22http%3A%2F%2Fschemas.microsoft.com%2Fappx%2Fmanifest%2Fcom%2Fwindows10%22%5D%5B1%5D%2F%40LibraryFlag%0A%5B10%2F26%2F2021%202%3A06%3A34%20PM%5D%20%5BDebug%5D%20'%230'%20violates%20pattern%20constraint%20of%20'%5B0-9a-fA-F%5D'.%0A%5B10%2F26%2F2021%202%3A06%3A34%20PM%5D%20%5BDebug%5D%20The%20attribute%20'LibraryFlag'%20with%20value%20'%230'%20failed%20to%20parse.%0A%5B10%2F26%2F2021%202%3A06%3A34%20PM%5D%20%5BDebug%5D%20Cleaning%20up%20output%20file%20%22%5C%5C%3F%5C%25UserProfile%25%5CDesktop%5CSW01037-02_2021.0.1.0_x64__gs30ax5hs4rre.msix%22.%0A%5B10%2F26%2F2021%202%3A06%3A34%20PM%5D%20%5BDebug%5D%20MakeAppx%20%3A%20error%3A%20Failure%20at%20(CreatePackage(%20overwrite%2C%20hashAlgorithm%2C%20fileList%2C%20outputPath%2C%20manifestStream.Get()%2C%20forceCompressionNone%2C%20performanceOptions%2C%20encryptPackage%2C%20encryptionOptions%2C%20cgmPath%2C%20mainPackagePathForResourceExemption%2C%20makepriExeFullPath))%20-%200x80080204%20-%20The%20specified%20package%20format%20is%20not%20valid%3A%20The%20package%20manifest%20is%20not%20valid.%0A%5B10%2F26%2F2021%202%3A06%3A34%20PM%5D%20%5BDebug%5D%20MakeAppx%20%3A%20error%3A%20Package%20creation%20failed.%0A%5B10%2F26%2F2021%202%3A06%3A34%20PM%5D%20%5BDebug%5D%20MakeAppx%20%3A%20error%3A%200x80080204%20-%20The%20specified%20package%20format%20is%20not%20valid%3A%20The%20package%20manifest%20is%20not%20valid.%0A%5B10%2F26%2F2021%202%3A06%3A34%20PM%5D%20%5BError%5D%20MakeAppx.exe%20failed%2C%20exit%20code%20%3D%201%0A%5B10%2F26%2F2021%202%3A06%3A34%20PM%5D%20%5BDebug%5D%20Finalizing%20the%20conversion%20state%0A%5B10%2F26%2F2021%202%3A06%3A34%20PM%5D%20%5BDebug%5D%20Getting%20environment%20object%20from%20%25UserProfile%25%5CAppData%5CLocal%5CPackages%5CMicrosoft.MsixPackagingTool_8wekyb3d8bbwe%5CLocalState%5CMsixGenerator.ConversionState.xml%0A%5B10%2F26%2F2021%202%3A06%3A34%20PM%5D%20%5BDebug%5D%20Releasing%20global%20semaphore%0A%5B10%2F26%2F2021%202%3A06%3A34%20PM%5D%20%5BWarning%5D%20Error%20Occurred%3A%20Microsoft.Msix.Utils.ProcessRunner.ProcessRunnerException%3A%20Process%20MakeAppx.exe%20failed%20with%20exit%20code%201.%0A%20%20%20at%20Microsoft.Msix.Utils.ProcessRunner.ProcessRunnerBase.ValidateExitCode(Int32%5B%5D%20validCodes)%0A%20%20%20at%20Microsoft.ApplicationVirtualization.Packaging.Packager.FinalizePackageViaMakeAppx(IPackageFiles%20packageFiles%2C%20String%20manifestPath%2C%20String%20appvManifestPath%2C%20String%20registryHivePath%2C%20Boolean%20useExistingRegisterHive%2C%20String%20userRegistryHivePath%2C%20String%20userClassesRegistryHivePath%2C%20String%20packagePath%2C%20String%20msixMappingPath%2C%20CompressionOption%20compression%2C%20MsixPackageInputProperties%20msixPackageInputProperties%2C%20CancellationTokenSource%20cancellationTokenSource)%0A%20%20%20at%20MsixGenerator.MsixPackageEditor.FinalizePackage(CancellationTokenSource%20cancellationTokenSource%2C%20Boolean%20modifyExistingPackage)%0A%20%20%20at%20MsixPackagingTool.ViewModel.PackageEditorWorkflow.MasterPackageEditorViewModel.SavePackageEditorChanges_BackgroundWorker(Object%20sender%2C%20DoWorkEventArgs%20doWorkEventArgs)%0A%20%20%20at%20System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs%20e)%0A%20%20%20at%20System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object%20argument)%0A%5B10%2F26%2F2021%202%3A26%3A15%20PM%5D%20%5BDebug%5D%20Spawning%20background%20worker%20thread.%0A%5B10%2F26%2F2021%202%3A26%3A15%20PM%5D%20%5BDebug%5D%20IgnorableNamespaces%20attribute%20value%20is%20%3A%20uap%20uap2%20uap3%20uap10%20rescap%20rescap3%20com%0A%5B10%2F26%2F2021%202%3A26%3A15%20PM%5D%20%5BDebug%5D%20Adding%20Capability%3A%20runFullTrust%0A%5B10%2F26%2F2021%202%3A26%3A15%20PM%5D%20%5BDebug%5D%20Translating%20Packaged%20Services%20to%20Manifest%0A%5B10%2F26%2F2021%202%3A26%3A15%20PM%5D%20%5BDebug%5D%20IgnorableNamespaces%20attribute%20value%20is%20%3A%20uap%20uap2%20uap3%20uap10%20rescap%20rescap3%20com%0A%5B10%2F26%2F2021%202%3A26%3A15%20PM%5D%20%5BDebug%5D%20File%20type%20associated%20with%20Manifest%3A%20notepad.exe%0A%5B10%2F26%2F2021%202%3A26%3A16%20PM%5D%20%5BDebug%5D%20Manifest%20Process%20Exited.%0A%5B10%2F26%2F2021%202%3A26%3A16%20PM%5D%20%5BDebug%5D%20Attempting%20to%20read%20and%20validate%20the%20saved%20manifest%20file%3A%20%25UserProfile%25%5CAppData%5CLocal%5CPackages%5CMicrosoft.MsixPackagingTool_8wekyb3d8bbwe%5CLocalState%5CDiagOutputDir%5CLogs%5C1pcyhnxe.iwe.Manifest%20%0A%5B10%2F26%2F2021%202%3A26%3A16%20PM%5D%20%5BError%5D%20System.Runtime.InteropServices.COMException%20(0x80080204)%3A%20%2F*%5Blocal-name()%3D%22Package%22%20and%20namespace-uri()%3D%22http%3A%2F%2Fschemas.microsoft.com%2Fappx%2Fmanifest%2Ffoundation%2Fwindows10%22%5D%2F*%5Blocal-name()%3D%22Extensions%22%20and%20namespace-uri()%3D%22http%3A%2F%2Fschemas.microsoft.com%2Fappx%2Fmanifest%2Ffoundation%2Fwindows10%22%5D%5B1%5D%2F*%5Blocal-name()%3D%22Extension%22%20and%20namespace-uri()%3D%22http%3A%2F%2Fschemas.microsoft.com%2Fappx%2Fmanifest%2Fcom%2Fwindows10%22%5D%5B1%5D%2F*%5Blocal-name()%3D%22ComInterface%22%20and%20namespace-uri()%3D%22http%3A%2F%2Fschemas.microsoft.com%2Fappx%2Fmanifest%2Fcom%2Fwindows10%22%5D%5B1%5D%2F*%5Blocal-name()%3D%22TypeLib%22%20and%20namespace-uri()%3D%22http%3A%2F%2Fschemas.microsoft.com%2Fappx%2Fmanifest%2Fcom%2Fwindows10%22%5D%5B9%5D%2F*%5Blocal-name()%3D%22Version%22%20and%20namespace-uri()%3D%22http%3A%2F%2Fschemas.microsoft.com%2Fappx%2Fmanifest%2Fcom%2Fwindows10%22%5D%5B1%5D%2F%40LibraryFlag%0A'%230'%20violates%20pattern%20constraint%20of%20'%5B0-9a-fA-F%5D'.%0AThe%20attribute%20'LibraryFlag'%20with%20value%20'%230'%20failed%20to%20parse.%0A%0A%20%20%20at%20System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32%20errorCode%2C%20IntPtr%20errorInfo)%0A%20%20%20at%20Microsoft.ApplicationVirtualization.Packaging.Impl.AppxManifestReader..ctor(String%20path)%0A%20%20%20at%20Microsoft.ApplicationVirtualization.Packaging.AppxPackageFactory.ReadManifest(String%20path)%0A%20%20%20at%20MsixGenerator.MsixPackageEditor.ValidateManifestOrThrow(String%20manifestPath)%0A%20%20%20at%20MsixGenerator.MsixPackageEditor.TryParseManifestFile(String%20manifestPath)%0A%5B10%2F26%2F2021%202%3A26%3A16%20PM%5D%20%5BWarning%5D%20Unable%20to%20parse%20manifest.%20Edit%20the%20manifest%20file%20to%20fix%20errors.%0A%5B10%2F26%2F2021%202%3A26%3A16%20PM%5D%20%5BDebug%5D%20Returning%20back%20to%20Package%20Editor%20view.%0A%5B10%2F26%2F2021%202%3A35%3A05%20PM%5D%20%5BDebug%5D%20Spawning%20background%20worker%20thread.%0A%5B10%2F26%2F2021%202%3A35%3A05%20PM%5D%20%5BDebug%5D%20Enabling%20services%20that%20were%20disabled%20while%20preparing%20environment%0A%5B10%2F26%2F2021%202%3A35%3A05%20PM%5D%20%5BDebug%5D%20----------------Create%20Package%20View----------------%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20found%20a%20sort%20off%20some%20issue%2C%20tried%20that%20but%20that%20gave%20me%20the%20same%20error%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fmsix-packaging-and-tools%2Ferror-creating-msix-package%2Fm-p%2F1567302%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fmsix-packaging-and-tools%2Ferror-creating-msix-package%2Fm-p%2F1567302%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20one%20a%20idea%20to%20fix%20this%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThnx!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2885891%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMSIX%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2887645%22%20slang%3D%22en-US%22%3ERe%3A%20Error%20creating%20an%20MSIX%20Package%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2887645%22%20slang%3D%22en-US%22%3EYou'll%20have%20to%20post%20the%20actual%20AppXManifest%20file.%20There%20is%20something%20wrong%20in%20it.%20I%20would%20look%20for%20a%20parameter%20called%20%22LibraryFlag%22%20in%20there%20that%20has%20a%20value%20of%20%22%230%22.%20It%20probably%20is%20a%20TypeLib%20and%20you%20need%20to%20just%20remove%20the%20%22%23%22.%3C%2FLINGO-BODY%3E
Occasional Contributor

Hello, I'am trying to create a MSIX package but it fails. The log file:

I

 

[10/26/2021 2:06:34 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/2021 2:06:34 PM] [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"][9]/*[local-name()="Version" and namespace-uri()="http://schemas.microsoft.com/appx/manifest/com/windows10"][1]/@LibraryFlag
[10/26/2021 2:06:34 PM] [Debug] '#0' violates pattern constraint of '[0-9a-fA-F]'.
[10/26/2021 2:06:34 PM] [Debug] The attribute 'LibraryFlag' with value '#0' failed to parse.
[10/26/2021 2:06:34 PM] [Debug] Cleaning up output file "\\?\%UserProfile%\Desktop\SW01037-02_2021.0.1.0_x64__gs30ax5hs4rre.msix".
[10/26/2021 2:06:34 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/2021 2:06:34 PM] [Debug] MakeAppx : error: Package creation failed.
[10/26/2021 2:06:34 PM] [Debug] MakeAppx : error: 0x80080204 - The specified package format is not valid: The package manifest is not valid.
[10/26/2021 2:06:34 PM] [Error] MakeAppx.exe failed, exit code = 1
[10/26/2021 2:06:34 PM] [Debug] Finalizing the conversion state
[10/26/2021 2:06:34 PM] [Debug] Getting environment object from %UserProfile%\AppData\Local\Packages\Microsoft.MsixPackagingTool_8wekyb3d8bbwe\LocalState\MsixGenerator.ConversionState.xml
[10/26/2021 2:06:34 PM] [Debug] Releasing global semaphore
[10/26/2021 2:06:34 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/2021 2:26:15 PM] [Debug] Spawning background worker thread.
[10/26/2021 2:26:15 PM] [Debug] IgnorableNamespaces attribute value is : uap uap2 uap3 uap10 rescap rescap3 com
[10/26/2021 2:26:15 PM] [Debug] Adding Capability: runFullTrust
[10/26/2021 2:26:15 PM] [Debug] Translating Packaged Services to Manifest
[10/26/2021 2:26:15 PM] [Debug] IgnorableNamespaces attribute value is : uap uap2 uap3 uap10 rescap rescap3 com
[10/26/2021 2:26:15 PM] [Debug] File type associated with Manifest: notepad.exe
[10/26/2021 2:26:16 PM] [Debug] Manifest Process Exited.
[10/26/2021 2:26:16 PM] [Debug] Attempting to read and validate the saved manifest file: %UserProfile%\AppData\Local\Packages\Microsoft.MsixPackagingTool_8wekyb3d8bbwe\LocalState\DiagOutputDir\Logs\1pcyhnxe.iwe.Manifest 
[10/26/2021 2:26:16 PM] [Error] System.Runtime.InteropServices.COMException (0x80080204): /*[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"][9]/*[local-name()="Version" and namespace-uri()="http://schemas.microsoft.com/appx/manifest/com/windows10"][1]/@LibraryFlag
'#0' violates pattern constraint of '[0-9a-fA-F]'.
The attribute 'LibraryFlag' with value '#0' failed to parse.

   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/2021 2:26:16 PM] [Warning] Unable to parse manifest. Edit the manifest file to fix errors.
[10/26/2021 2:26:16 PM] [Debug] Returning back to Package Editor view.
[10/26/2021 2:35:05 PM] [Debug] Spawning background worker thread.
[10/26/2021 2:35:05 PM] [Debug] Enabling services that were disabled while preparing environment
[10/26/2021 2:35:05 PM] [Debug] ----------------Create Package View----------------

 

 

 

I found a sort off some issue, tried that but that gave me the same error;

https://techcommunity.microsoft.com/t5/msix-packaging-and-tools/error-creating-msix-package/m-p/1567...

 

Any one a idea to fix this?

 

Thnx!

2 Replies
best response confirmed by Trebke86 (Occasional Contributor)
Solution
You'll have to post the actual AppXManifest file. There is something wrong in it. I would look for a parameter called "LibraryFlag" in there that has a value of "#0". It probably is a TypeLib and you need to just remove the "#".
That was it! Thanks Timothy!