TargetDeviceFamily无法识别

时间:2017-09-01 23:47:39

标签: xml visual-studio xaml packaging targets

我的package.appxmanifest中有以下代码,我收到的错误是TargetDeviceFamily是一个“无法识别的XML元素”......我不知道到底是怎么回事在,但是这个文件是我发布我的应用程序的最后一件事,我正在失去理智。在MSDN上找不到任何东西,他们的支持不是那么支持。

代码:

  <Dependencies>
    <TargetDeviceFamily Name="Windows.Desktop" MinVersion="6.3.0" MaxVersionTested="6.3.0" />
  </Dependencies>

错误:

enter image description here

修订:

当我删除DependanciesTargetDeviceFamily时,我收到此错误: enter image description here

2 个答案:

答案 0 :(得分:2)

您的package.appxmanifest是否包含所需的命名空间http://schemas.microsoft.com/appx/manifest/foundation/windows10

<Package 
  xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10">
  ...
  <Dependencies>
    <TargetDeviceFamily Name="Windows.Desktop" MinVersion="6.3.0" MaxVersionTested="6.3.0" />
  </Dependencies>
</Package>

答案 1 :(得分:1)

我认为你需要将最小和最大版本更新为

MinVersion="10.0.x.0" MaxVersionTested="10.0.y.0"