UWP:无法访问许可证信息

UWP: Cannot access LicenseInformation

如果应用内购买处于活动状态,我正在使用以下代码检查我的 UWP-JS 应用:

(function () {
    // Initialization
    // var store_app = Windows.ApplicationModel.Store.CurrentApp;
    var store_app = Windows.ApplicationModel.Store.CurrentAppSimulator;
    var licenseInformation = store_app.licenseInformation;

    // Check for Product
    if (licenseInformation.productLicenses["product1"].isActive) {
        // do something
    } else {};
})();

当我调试它时,第 5 行出现以下错误:

0x803d0000 - JavaScript runtime error: The input data was not in the expected format or did not have the expected value.

我正在关注这个Documentation

我做错了什么?

Atom 编辑器弄乱了 WindowsStoreProxy.xml 文件。
我刚刚删除了它并 Visual Studio 创建了一个新文件。