Cordova:'Windows is undefined' 在 UWP 应用程序上

Cordova: 'Windows is undefined' on UWP app

我正在尝试将 Win/WinPhone 8.1 应用程序迁移到 Win10 (UWP) 程序包。

到目前为止,该应用构建良好 运行,但在第一次引用 Windows 组件时崩溃:

Windows is undefined

(例如访问 Windows.Storage.ApplicationData.current

一些事实:

在试错时我还添加了一些参考,例如 Windows UWP 的移动扩展 Microsoft .NET 本机运行时包Windows ,但这不是原因。

知道缺少什么吗?

在 appxmanifest 定义中发现错误:

    <uap:ApplicationContentUriRules>
        <uap:Rule Match="ms-appx-web:///" Type="include" WindowsRuntimeAccess="all" />
    </uap:ApplicationContentUriRules>

未设置导致无法访问 Windows 运行时。