UWP 应用程序包信息示例应用程序 - 显示包标识的位置 [英] UWP App package information sample app - where it is showing package identity

查看:28
本文介绍了UWP 应用程序包信息示例应用程序 - 显示包标识的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 VS2017 最新版本 15.9.5 我成功部署了这个

解决方案

PackageId(请参阅 Docs) 不是一个简单的字符串,而是一个具有多个属性的完整类,这些属性使您可以访问共同构成应用程序唯一 ID 的各个组件.

对您来说最有趣的可能是 FullName,它是包特定版本的完整唯一标识符,以及 FamilyName,它是与版本无关的标识符您的应用.

PackageId 实例可从 Package.Current.Id 访问.

但是,如果您想在应用商店中生成指向您的应用的链接,则必须对在开发中心为您生成的特殊应用商店 ID 进行硬编码.您可以在文档此处找到有关此的详细信息.

Using VS2017 latest version 15.9.5 I successfully deployed this UWP Package sample (using their C# folder) from Microsoft's GitHub site on my Windows 10 Pro ver 1809 laptop. But on the sample app's main window (shown below), when I click 1) Identity --> Get Package it doesn't seem to show the package identity.

Question: What I may be missing or misunderstanding here?

NOTE: According to the above mentioned Microsoft article:

Each package is defined by a globally unique identifier known as the package identity. The sample covers following key tasks:

  • Getting the package identity using Package.Id
  • Getting the package directory using Package.InstalledLocation
  • etc. etc.

Sample app's main window when I run the sample:

解决方案

The PackageId (see Docs) is not a simple string, but instead a full class having several properties which give you access to individual components which together make up the application's unique ID.

The most interesting for you might be FullName, which is the full unique identifier of the specific version of your package, and FamilyName which is a version-agnostic identifier of your app.

The PackageId instance is accessible from Package.Current.Id.

However, if you want to generate a link to your app in the Store, you must instead hardcode the special Store ID which is generated for you in the Dev Center. You can find details for this here in Docs.

这篇关于UWP 应用程序包信息示例应用程序 - 显示包标识的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆