uwp - 无法编译 UWP 项目:应用程序包...清单验证错误
问题描述
更新
如下所述Remarks item 3
。当我在项目文件的属性 中添加命名空间xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
和值时,会导致以下错误。recap
IgnorableNamespaces="uap mp recap"
Package.appmanifest
当我回滚上述两个更改时,错误就消失了。
原帖
[添加上述值仍然存在问题 - 我确实想添加,除非有人提出更好的解决方案]
在我的UWP
项目中VS2017
,我在文件中收到以下编译错误...\bin\x86\Debug\AppxManifest.xml
:
验证错误。错误 80080204:应用清单验证错误:应用清单 XML 必须有效:第 2 行,第 427 列,原因:系统错误:-2142175169。
我的 Package.appmanifest 文件:
<?xml version="1.0" encoding="utf-8"?>
<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
IgnorableNamespaces="uap mp recap">
...
...\bin\x86\Debug\AppxManifest.xml 文件:
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" xmlns:build="http://schemas.microsoft.com/developer/appx/2015/build" IgnorableNamespaces="uap mp recap build">
<!--
THIS PACKAGE MANIFEST FILE IS GENERATED BY THE BUILD PROCESS.
Changes to this file will be lost when it is regenerated. To correct errors in this file, edit the source .appxmanifest file.
For more information on package manifest files, see http://go.microsoft.com/fwlink/?LinkID=241727
-->
....
....
评论
- 该错误似乎与
IgnorableNamespaces
属性中缺少命名空间别名值有关。现在,在Package.appmanifest file
它的...IgnorableNamespaces="uap mp recap">
. 而在...\bin\x86\Debug\AppxManifest.xml
它的IgnorableNamespaces="uap mp recap build">
. 所以AppxManifest.xml
在 Debug 文件夹中生成了一个带有 alias 的额外命名空间build
。但我不知道为什么 Visual Studio 会这样做,尽管我没有在Package.appmanifest
文件中声明。 xmlns:rescap="....."
在我向文件添加额外的命名空间之前,项目正在编译Package.appmanifest
。此外,即使我将xmlns:build="...."
命名空间从复制/粘贴Debug\AppxManifest.xml
到,Package.appmanifest
我仍然会得到完全相同的错误- 我尝试清理解决方案并重新编译但同样的错误。
解决方案
IgnorableNamespaces
我注意到您在属性中有错字:
IgnorableNamespaces="uap mp recap"
应该
IgnorableNamespaces="uap mp rescap"
注意缺少的“s”字符。是“ restricted capabilities ”的缩写
推荐阅读
- python - Pandas:如何用其他列上每一行的列表值拆分句子行?
- python-3.x - python中的逆局部线性嵌入LLE
- azure-data-explorer - Kusto:将结果过滤到每个 ID 的最新记录
- python-3.x - 如何将同时运行的 python 程序的输出和输入重定向到 __main__ python 程序
- css - Safari 无限 translateX 动画循环闪烁
- postgresql - 类型系统:ANSI SQL(标准)与 Postgres、Oracle、DB2
- php - PHP中的双边不等式
- mysql - 使用 sequelize 使用用户输入查询 MySql 数据库
- shopify - 如何在部分架构中添加默认 URL
- google-apps-script - Google Apps Script-TypeError:无法在 sendFormByEmail 处读取未定义的属性“toString”