Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/264.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# CurrentApp.LicenseInformation仅允许我访问一次_C#_Windows_Xamarin.forms_Uwp_Xamarin.uwp - Fatal编程技术网

C# CurrentApp.LicenseInformation仅允许我访问一次

C# CurrentApp.LicenseInformation仅允许我访问一次,c#,windows,xamarin.forms,uwp,xamarin.uwp,C#,Windows,Xamarin.forms,Uwp,Xamarin.uwp,我在调用CurrentApp.LicenseInformation时遇到问题,第一个呼叫在哪里通过,但如果我关闭应用并再次打开,下一个呼叫将锁定应用并关闭。但如果我等5-10分钟,再打开一次,我可以再次访问它,一次 这是我打电话时的方法: public bool HasPurchasedPlus() { var licenseInformation = CurrentApp.LicenseInformation; var iap1 = licenseInformation.Pr

我在调用
CurrentApp.LicenseInformation
时遇到问题,第一个呼叫在哪里通过,但如果我关闭应用并再次打开,下一个呼叫将锁定应用并关闭。但如果我等5-10分钟,再打开一次,我可以再次访问它,一次

这是我打电话时的方法:

public bool HasPurchasedPlus()
{
    var licenseInformation = CurrentApp.LicenseInformation;

    var iap1 = licenseInformation.ProductLicenses["Package1"].IsActive;
    var iap2 = licenseInformation.ProductLicenses["Package2"].IsActive;

    return iap1 || iap2;
}
如能帮助解决此问题,我们将不胜感激。
谢谢。

系统更新后,该问题从此消失。我不能肯定这是操作系统的问题,但目前看来这是由于从系统读取数据的问题,因为它也影响了文件的读取。

代码似乎没有问题。你能在其他设备上试用吗?看起来它在我的手机上运行Win 10,所以目前它只影响我桌面上运行的应用程序。值得注意的是,我正在两台设备上运行insider版本:PC:Windows 10 Pro insider Preview-版本:1607-操作系统版本:10.0.14942.1000 Mobile:Windows 10 Mobile-版本:1607-操作系统版本:10.0.14926.1000