无法编译UWP项目:应用程序包。。。清单验证错误 更新

无法编译UWP项目:应用程序包。。。清单验证错误 更新,uwp,Uwp,如下文第3项注释所述。添加名称空间xmlns时导致以下错误:rescap=”http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities“和项目的包的appmanifest文件的属性IgnorableNamespaces=“uap mp recap”中的值 当我回滚上述两个更改时,错误就消失了 原职 [添加上述值仍然存在问题-除非有人提出更好的解决方案,否则我确实希望添加这些值] 在我

如下文第3项注释所述。添加名称空间
xmlns时导致以下错误:rescap=”http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities“
和项目的
包的
appmanifest
文件的属性
IgnorableNamespaces=“uap mp recap”
中的值

当我回滚上述两个更改时,错误就消失了

原职 [添加上述值仍然存在问题-除非有人提出更好的解决方案,否则我确实希望添加这些值]

在我的
VS2017
UWP
项目中,我在文件
..\bin\x86\Debug\AppxManifest.xml
上得到以下编译错误:

验证错误。错误80080204:应用程序清单验证错误:应用程序清单XML必须有效:第2行第427列,原因:系统错误:-2142175169

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

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

...
…\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"
  IgnorableNamespaces="uap mp recap">

...
<?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文件中,它是
    …IgnorableNamespaces=“uap mp recap”>
    。在
    ..\bin\x86\Debug\AppxManifest.xml
    中,它是
    IgnorableNamespaces=“uap mp recap build”>
    。因此调试文件夹中的
    AppxManifest.xml
    正在生成一个别名为
    build
    的额外名称空间。但我不知道为什么VisualStudio会这样做,尽管我没有在
    Package.appmanifest
    文件中声明
  • 在我将一个额外的名称空间
    xmlns:rescap=“…”
    添加到
    Package.appmanifest
    文件之前,项目编译得很好。此外,即使我将
    xmlns:build=“…”
    命名空间从
    Debug\AppxManifest.xml
    复制/粘贴到
    Package.appmanifest
    中,我仍然会得到完全相同的错误
  • 我尝试清理解决方案并重新编译,但还是出现了相同的错误

  • 我注意到您在
    IgnorableNamespaces
    属性中有一个输入错误:

    IgnorableNamespaces="uap mp recap"
    
    应该是

    IgnorableNamespaces="uap mp rescap"
    

    请注意缺少的“s”字符。它是“restrictedcapabilities”的缩写。

    我注意到您在
    IgnorableNamespaces
    属性中有一个输入错误:

    IgnorableNamespaces="uap mp recap"
    
    应该是

    IgnorableNamespaces="uap mp rescap"
    

    请注意缺少的“s”字符。它是“restrictedcapabilities”的缩写。

    感谢您抓住了打字错误,并且(更重要的是)解释了为什么它是
    rescap
    而不是
    repack
    。现在开始工作了。很高兴听到这个消息!快乐编码!回答正确,但请不要告诉我字符串不必是
    rescap
    -它可以是
    banana
    ,因为所有的计算机都需要它。它只需要始终如一地使用:)谢谢你抓住了打字错误,(更重要的是)解释了为什么它是
    rescap
    ,而不是
    rescap
    。现在开始工作了。很高兴听到这个消息!快乐编码!回答正确,但请不要告诉我字符串不必是
    rescap
    -它可以是
    banana
    ,因为所有的计算机都需要它。它只是必须始终如一地使用:)