UWP web install - “Error in parsing the app package.”

时光毁灭记忆、已成空白 提交于 2019-12-11 02:34:45

问题


I created a simple web app and a simple UWP app.

In the web app, I've added a link to my uwp app. But after clicking on the link, the error comes "Error in parsing the app package.".

The .appxbundle is reachable, because if I remove ms-appinstaller:?source= from url, the downloading starts. Also, I've configured web app for MIME types.

The package seems to be valid, because if I double click on downloaded file, the installation completes.

Here some code samples:

Web.config:

 <system.webServer>
        <!--This is to allow the web server to serve resources with the appx/appxbundle/appinstaller extension-->
        <staticContent>
          <mimeMap fileExtension=".appx" mimeType="application/vns.ms-appx" />
          <mimeMap fileExtension=".appxbundle" mimeType="application/vns.ms-appx" />
          <mimeMap fileExtension=".appinstaller" mimeType="application/xml" />
        </staticContent>
  </system.webServer>

HTML page:

<html>
<head>
    <meta charset="utf-8" />
    <title> Install Page </title>
</head>
<body>
    <a href="ms-appinstaller:?source=http://localhost/UwpHost/packages/UniversalApp_1.0.5.0_x86_x64_arm.appxbundle"> Install My Sample App</a>
</body>
</html>

Any idea what could be missed?

I was following steps on this link on MSDN.


回答1:


he error comes "Error in parsing the app package.".

Derive from official document.

UWP apps like App Installer are restricted to use IP loopback addresses like http://localhost/. When using local IIS Server, App Installer must be added to the loopback exempt list.

Before use ms-appinstaller:?source=, you need to add appinstaller to the loopback exempt list. Please use the following command line.

CheckNetIsolation.exe LoopbackExempt -a -n=microsoft.desktopappinstaller_8wekyb3d8bbwe

For more detail please refer Add loopback exemption for App Installer.



来源:https://stackoverflow.com/questions/50722997/uwp-web-install-error-in-parsing-the-app-package

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!