Why does CurrentApp :: AppId take so long in Windows Phone 10?

I have a universal Windows 8 project and have a function to get the APP ID. The following function works well in Windows Phone 8.1

Platform::Guid appId = Windows::ApplicationModel::Store::CurrentApp::AppId; 

however, he spent about 40 seconds on Windows Phone 10.

Of MSDN, only metadata is different,

Can I find out if this is due to metadata? And how to solve it?

+1
source share
1 answer

Instead of AppID you can use the following code,

 Windows::ApplicationModel::Package^ package = Windows::ApplicationModel::Package::Current; Windows::ApplicationModel::PackageId^ packageId = package->Id; Windows::ApplicationModel::PackageVersion version = packageId->Version; Platform::String^ output = "Name: \"" + packageId->Name + "\"\n" + "Version: " + version.Major.ToString() + "." + version.Minor.ToString() + "." + version.Revision.ToString() + "." + version.Build.ToString() + "\n" + "Architecture: " + packageId->Architecture.ToString() + "\n" + "ResourceId: \"" + packageId->ResourceId + "\"\n" + "Publisher: \"" + packageId->Publisher + "\"\n" + "PublisherId: \"" + packageId->PublisherId + "\"\n" + "FullName: \"" + packageId->FullName + "\"\n" + "FamilyName: \"" + packageId->FamilyName + "\"\n" + "IsFramework: " + package->IsFramework.ToString(); 

Device Output Example

Output: Name: "f3e02737-ddfa-47a0-a837-37ee53459898" Version: 1.0.0.0 Architecture: Arm ResourceId: "" Publisher: "CN=heefan" PublisherId: "gsbawe9kfjm1p" FullName: "f3e02737-ddfa-47a0-a837-37ee53459898_1.0.0.0_arm__gsbawe9kfjm1p" FamilyName: "f3e02737-ddfa-47a0-a837-37ee53459898_gsbawe9kfjm1p" IsFramework: false

I also don't know why the AppID takes a long time to compute.

0
source

Source: https://habr.com/ru/post/1244831/


All Articles