UWP Web 安装 - “解析应用程序包时出错." [英] UWP web install - “Error in parsing the app package.”

查看:44
本文介绍了UWP Web 安装 - “解析应用程序包时出错."的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个简单的 Web 应用和一个简单的 UWP 应用.

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

在网络应用程序中,我添加了一个指向我的 uwp 应用程序的链接.但是点击链接后,报错解析应用包时出错.".

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.".

.appxbundle 是可访问的,因为如果我从 url 中删除 ms-appinstaller:?source= ,下载就会开始.此外,我已经为 MIME 类型配置了网络应用.

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.

这里有一些代码示例:

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 页面:

<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?

我正在按照 MSDN 上此 链接的步骤进行操作.

I was following steps on this link on MSDN.

推荐答案

他的错误是解析应用程序包时出错.".

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

来源于官方文档.

应用安装程序等 UWP 应用被限制使用 IP 环回地址,例如 http://localhost/.使用本地 IIS 服务器时,必须将 App Installer 添加到环回豁免列表中.

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.

在使用ms-appinstaller:?source=之前,您需要将appinstaller添加到环回豁免列表中.请使用以下命令行.

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.

这篇关于UWP Web 安装 - “解析应用程序包时出错."的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆