SOLVED

'Error parsing app package' error after version change

%3CLINGO-SUB%20id%3D%22lingo-sub-2873257%22%20slang%3D%22en-US%22%3E'Error%20parsing%20app%20package'%20error%20after%20version%20change%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2873257%22%20slang%3D%22en-US%22%3E%3CP%3EI%20build%20an%20MSIX%20package%20bundle%20and%20deployed%20to%20an%20Azure%20App%20Service.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EEverything%20works%20fine%20and%20I%20can%20install%20the%20app.%20But%20when%20I%20deploy%20a%20new%20version%20it%20fails%20to%20auto%20update%20and%20when%20I%20try%20to%20install%20the%20application%20again%20it%20fails%20with%20%22%3CSPAN%3EError%20parsing%20app%20package%22%20error.%3CBR%20%2F%3E%3CBR%20%2F%3EIf%20I%20sign%20out%20or%20restart%20my%20PC%2C%20it%20works.%20I'm%20not%20sure%20what%20to%20do%20to%20solve%20this%2C%20because%20the%20installer%20works.%20How%20can%20I%20solve%20this%3F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EIt%20looks%20like%20a%20caching%20issue%20or%20something%20similar%2C%20as%20described%20here.%20The%26nbsp%3B%3CSPAN%3EDelivery%20Optimization%20Service%20doesn't%20download%20the%20entire%20App%20Installer%20file%20and%20because%20of%20this%20it%20fails%20to%20parse%20it.%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fstackoverflow.com%2Fquestions%2F64381453%2Fappinstaller-xml-issue%2F68976913%2368976913%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fstackoverflow.com%2Fquestions%2F64381453%2Fappinstaller-xml-issue%2F68976913%2368976913%3C%2FA%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EI%20even%20tried%20the%20suggested%20workaround%20-%20to%20pad%20the%20contents%20of%20the%20App%20Installer%20file.%20But%20still%20doesn't%20work.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3ENot%20sure%20what%20else%20can%20I%20do%20here.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CBR%20%2F%3EThis%20is%20my%20App%20Installer%20file.%20I%20removed%20sensitive%20information%20so%20the%20urls%20will%20not%20work.%3CBR%20%2F%3E%3CBR%20%2F%3E%60%60%60%3CBR%20%2F%3E%3CBR%20%2F%3E%3CAPPINSTALLER%3E%3CBR%20%2F%3EUri%3D%22%3CA%20href%3D%22https%3A%2F%2Fd1-myapp-setup-wba.azurewebsites.net%2FPOS.Installer.appinstaller%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fd1-myapp-setup-wba.azurewebsites.net%2FPOS.Installer.appinstaller%3C%2FA%3E%22%3CBR%20%2F%3EVersion%3D%221.0.0.46%22%20xmlns%3D%22%3CA%20href%3D%22http%3A%2F%2Fschemas.microsoft.com%2Fappx%2Fappinstaller%2F2017%2F2%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttp%3A%2F%2Fschemas.microsoft.com%2Fappx%2Fappinstaller%2F2017%2F2%3C%2FA%3E%22%26gt%3B%3CBR%20%2F%3E%3CMAINBUNDLE%3E%3CBR%20%2F%3EName%3D%22954a406f-c23f-4089-9b7f-b2241bfb3245%22%3CBR%20%2F%3EVersion%3D%221.0.0.46%22%3CBR%20%2F%3EPublisher%3D%22CN%3DMyCompany%22%3CBR%20%2F%3EUri%3D%22%3CA%20href%3D%22https%3A%2F%2Fd1-myapp-setup-wba.azurewebsites.net%2FPOS.Installer_1.0.0.46_Test%2FPOS.Installer_1.0.0.46_AnyCPU.msixbundle%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fd1-myapp-setup-wba.azurewebsites.net%2FPOS.Installer_1.0.0.46_Test%2FPOS.Installer_1.0.0.46_AnyCPU.msixbundle%3C%2FA%3E%22%20%2F%26gt%3B%3CBR%20%2F%3E%3CUPDATESETTINGS%3E%3CBR%20%2F%3E%3CONLAUNCH%3E%3CBR%20%2F%3EHoursBetweenUpdateChecks%3D%220%22%20%2F%26gt%3B%3CBR%20%2F%3E%3C%2FONLAUNCH%3E%3CBR%20%2F%3E%3C%2FUPDATESETTINGS%3E%3CBR%20%2F%3E%60%60%60%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FMAINBUNDLE%3E%3C%2FAPPINSTALLER%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EThis%20is%20my%20web.config%20in%20the%20Azure%20App%20Service%3A%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3E%60%60%60%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CBR%20%2F%3E%3CCONFIGURATION%3E%3CBR%20%2F%3E%3CSYSTEM.WEBSERVER%3E%3CBR%20%2F%3E%3CSTATICCONTENT%3E%3CBR%20%2F%3E%3CMIMEMAP%20fileextension%3D%22%26quot%3B.msix%26quot%3B%22%20mimetype%3D%22%26quot%3Bapplication%2Fmsix%26quot%3B%22%3E%3C%2FMIMEMAP%3E%3CBR%20%2F%3E%3CMIMEMAP%20fileextension%3D%22%26quot%3B.msixbundle%26quot%3B%22%20mimetype%3D%22%26quot%3Bapplication%2Fmsixbundle%26quot%3B%22%3E%3C%2FMIMEMAP%3E%3CBR%20%2F%3E%3CMIMEMAP%20fileextension%3D%22%26quot%3B.appx%26quot%3B%22%20mimetype%3D%22%26quot%3Bapplication%2Fvns.ms-appx%26quot%3B%22%3E%3C%2FMIMEMAP%3E%3CBR%20%2F%3E%3CMIMEMAP%20fileextension%3D%22%26quot%3B.appxbundle%26quot%3B%22%20mimetype%3D%22%26quot%3Bapplication%2Fvns.ms-appx%26quot%3B%22%3E%3C%2FMIMEMAP%3E%3CBR%20%2F%3E%3CMIMEMAP%20fileextension%3D%22%26quot%3B.appinstaller%26quot%3B%22%20mimetype%3D%22%26quot%3Bapplication%2Fxml%26quot%3B%22%3E%3C%2FMIMEMAP%3E%3CBR%20%2F%3E%3C%2FSTATICCONTENT%3E%3CBR%20%2F%3E%3CHTTPPROTOCOL%3E%3CBR%20%2F%3E%3CCUSTOMHEADERS%3E%3CBR%20%2F%3E%3CADD%20name%3D%22%26quot%3BPragma%26quot%3B%22%20value%3D%22%26quot%3Bno-cache%26quot%3B%22%3E%3C%2FADD%3E%3CBR%20%2F%3E%3CADD%20name%3D%22%26quot%3BCache-Control%26quot%3B%22%20value%3D%22%26quot%3Bmax-age%3D0%2C%22%20no-cache%3D%22%22%3E%3C%2FADD%3E%3CBR%20%2F%3E%3CADD%20name%3D%22%26quot%3BExpires%26quot%3B%22%20value%3D%22%26quot%3BSat%2C%22%2001%3D%22%22%20jan%3D%22%22%202000%3D%22%22%2000%3D%22%22%20gmt%3D%22%22%3E%3C%2FADD%3E%3CBR%20%2F%3E%3C%2FCUSTOMHEADERS%3E%3CBR%20%2F%3E%3C%2FHTTPPROTOCOL%3E%3CBR%20%2F%3E%3C%2FSYSTEM.WEBSERVER%3E%3CBR%20%2F%3E%3C%2FCONFIGURATION%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%60%60%60%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2873257%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3Eappinstaller%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMSIX%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2873324%22%20slang%3D%22en-US%22%3ERe%3A%20'Error%20parsing%20app%20package'%20error%20after%20version%20change%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2873324%22%20slang%3D%22en-US%22%3ERelated%20issue%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fmsix-deployment%2Fwindows-10-2004-msix-not-updating-please-check-whether-the%2Fm-p%2F1466701%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fmsix-deployment%2Fwindows-10-2004-msix-not-updating-please-check-whether-the%2Fm-p%2F1466701%3C%2FA%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2873561%22%20slang%3D%22en-US%22%3ERe%3A%20'Error%20parsing%20app%20package'%20error%20after%20version%20change%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2873561%22%20slang%3D%22en-US%22%3EHi%2C%3CBR%20%2F%3E%3CBR%20%2F%3EI%20debugged%20this%20and%20found%20a%20workaround%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FMicrosoftDocs%2Fmsix-docs%2Fissues%2F188%23issuecomment-947934682%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2FMicrosoftDocs%2Fmsix-docs%2Fissues%2F188%23issuecomment-947934682%3C%2FA%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

I integrated MSIX into a WinForms project and configured it as a package bundle and deployed to an Azure App Service.

 

Everything works fine and I can install the app. But when I deploy a new version it fails to auto update and when I try to install the application again it fails with "Error parsing app package" error.

If I sign out or restart my PC, it works. I'm not sure what to do to solve this, because the installer works. How can I solve this?

 

It looks like a caching issue or something similar, as described here. The Delivery Optimization Service doesn't download the entire App Installer file and because of this it fails to parse it.

 

https://stackoverflow.com/questions/64381453/appinstaller-xml-issue/68976913#68976913

 

I even tried the suggested workaround - to pad the contents of the App Installer file. But still doesn't work.

 

Not sure what else can I do here.


This is my App Installer file. I removed sensitive information so the urls will not work.

```
<?xml version="1.0" encoding="utf-8"?>
<AppInstaller
Uri="https://d1-myapp-setup-wba.azurewebsites.net/POS.Installer.appinstaller"
Version="1.0.0.46" xmlns="http://schemas.microsoft.com/appx/appinstaller/2017/2">
<MainBundle
Name="954a406f-c23f-4089-9b7f-b2241bfb3245"
Version="1.0.0.46"
Publisher="CN=MyCompany"
Uri="https://d1-myapp-setup-wba.azurewebsites.net/POS.Installer_1.0.0.46_Test/POS.Installer_1.0.0.46_AnyC..." />
<UpdateSettings>
<OnLaunch
HoursBetweenUpdateChecks="0" />
</UpdateSettings>
</AppInstaller>
```


 

This is my web.config in the Azure App Service:

 

```

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension=".msix" mimeType="application/msix" />
<mimeMap fileExtension=".msixbundle" mimeType="application/msixbundle" />
<mimeMap fileExtension=".appx" mimeType="application/vns.ms-appx" />
<mimeMap fileExtension=".appxbundle" mimeType="application/vns.ms-appx" />
<mimeMap fileExtension=".appinstaller" mimeType="application/xml" />
</staticContent>
<httpProtocol>
<customHeaders>
<add name="Pragma" value="no-cache" />
<add name="Cache-Control" value="max-age=0, no-cache, no-store, must-revalidate" />
<add name="Expires" value="Sat, 01 Jan 2000 00:00:00 GMT"/>
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration>

```

4 Replies
best response confirmed by szilardd (Occasional Contributor)
Thanks @MikeH. This is in line with the workaround mentioned here:
https://stackoverflow.com/questions/64381453/appinstaller-xml-issue/68976913#68976913

I had implemented the workaround but there was an issue in the way I did the padding - which is now fixed and looks to work.
Great. The thread has a little bit of PowerShell on it that can be used to do the padding.