Important
设备元数据已弃用,并将在 Windows 的将来版本中删除。 有关替代功能的信息,请参阅驱动程序包容器元数据。
本主题介绍如何将体验 ID 添加到 UWP 设备应用。 The experience ID is a GUID that uniquely identifies a device metadata package; it's required if your app is configured for automatic installation, as is the case with UWP device apps for printers and cameras.
如果你的应用被指定为特权应用且未配置为自动安装,则可以跳过此步骤。
UWP 设备应用是一种特殊的 UWP 应用,设备制造商创建它作为其内部或外围设备的配套。 通过使用设备元数据,设备应用可以执行特权操作,并在设备插入时自动进行安装。 有关 UWP 设备应用的详细信息,请参阅 了解 UWP 设备应用。
本主题是分步系列的一部分。 请参阅 “逐步构建 UWP 设备应用” 以了解简介。
在您开始之前
This step requires the StoreManifest.xml file that was created in the previous step. StoreManifest.xml 文件指定体验 ID。
将 StoreManifest.xml 添加到项目
体验 ID 在 StoreManifest.xml 文件中指定。 此 ID 将应用链接到设备元数据。
Important
StoreManifest.xml 文件必须存储在应用的项目的根文件夹中,而不是存储在解决方案的根文件夹中。
向项目添加 StoreManifest.xml
In Solution Explorer, right-click the project and choose Add > Existing Item.
在“ 添加现有项 ”对话框中,选择在 上一步中创建的 StoreManifest.xml 文件。
将 StoreManifest.xml 文件添加到项目后,查看其属性。 Right-click the StoreManifest.xml file and select Properties. This highlights the Properties window.
In the Properties window, ensure that the Build Action property equals Content and the Copy to Output Directory property equals Do not copy.
有关 StoreManifest.xml 文件的详细信息,请参阅 StoreManifest 架构参考。