创建混合现实3D图标时,如何解决package.appxmanifest中的命名空间错误?

我正在尝试为Unity 3D UWP项目中的悬崖房屋添加一个MixedReality 3D图标。

因此,我遵循了官方文档(https://docs.microsoft.com/en-us/windows/mixed-reality/implementing-3d-app-launchers),我的package.appxmanifest现在包含以下几行:

<Package xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:uap2="http://schemas.microsoft.com/appx/manifest/uap/windows10/2" xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3" xmlns:uap4="http://schemas.microsoft.com/appx/manifest/uap/windows10/4" xmlns:uap5="https://schemas.microsoft.com/appx/manifest/uap/windows10/5" xmlns:iot="http://schemas.microsoft.com/appx/manifest/iot/windows10" xmlns:mobile="http://schemas.microsoft.com/appx/manifest/mobile/windows10" IgnorableNamespaces="uap uap2 uap3 uap4 uap5 mp mobile iot" xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10">

<uap:DefaultTile ShortName="Kaldor - Your Public Art Project 2019" Wide310x150Logo="Assets\Wide310x150Logo.png" Square71x71Logo="Assets\Square71x71Logo.png" Square310x310Logo="Assets\Square310x310Logo.png">
  <uap:ShowNameonTiles>
    <uap:ShowOn Tile="square310x310Logo" />
    <uap:ShowOn Tile="wide310x150Logo" />
  </uap:ShowNameonTiles>
  <uap5:MixedRealityModel Path="Assets\StoreModel1.glb" />
</uap:DefaultTile>

但是我收到此控制台错误:

The element 'DefaultTile' in namespace 'http://schemas.microsoft.com/appx/manifest/uap/windows10' has invalid child element 'MixedRealityModel' in namespace 'https://schemas.microsoft.com/appx/manifest/uap/windows10/5'. List of possible elements expected: 'TileUpdate' in namespace 'http://schemas.microsoft.com/appx/manifest/uap/windows10' as well as 'MixedRealityModel' in namespace 'http://schemas.microsoft.com/appx/manifest/uap/windows10/5' as well as 'HoloContentChoice' in namespace 'http://schemas.microsoft.com/appx/manifest/uap/windows10'.

我已经按照文档和主题上的官方MS视频观看,看不到我错过的内容吗?

wqh467212692 回答:创建混合现实3D图标时,如何解决package.appxmanifest中的命名空间错误?

您的Package标记中的架构URL不一致。对于http以外的每个URL,您都使用https://schemas.microsoft.com/appx/manifest/uap/windows10/5。在https中使用uap10/5

由于uap10http://schemas.microsoft.com/appx/manifest/uap/windows10的子元素,并且由于您使用http://schemas.microsoft.com/appx/manifest/uap/windows10/5,因此它期望https://schemas.microsoft.com/appx/manifest/uap/windows10/5而不是http作为子元素。 (请注意,URL的细微差别。)

这正是您得到的错误:

  

名称空间“ http://schemas.microsoft.com/appx/manifest/uap/windows10”中的元素“ DefaultTile”在名称空间“ https://schemas.microsoft.com/appx/manifest/uap/windows10/5”中具有无效的子元素“ MixedRealityModel”。

它告诉您期望http

  

可能的元素列表:[...]以及名称空间'{http://schemas.microsoft.com/appx/manifest/uap/windows10/5'中的'MixedRealityModel'

但是,您不应将10/5切换到https,而应将其他所有内容切换到{{1}}。

本文链接:https://www.f2er.com/3139351.html

大家都在问