C# 中的 DeviceExtendedProperties - Microsoft.Phone.Info 名称 space

DeviceExtendedProperties in C# - Microsoft.Phone.Info name space

在 Windows Phone 8.1 中,在 C# 项目中,我想通过 -> DeviceExtendedProperties 获取设备 ID 所以我可能想这样做

using Microsoft.Phone.Info;
DeviceExtendedProperties.GetValue("DeviceUniqueId");

Microsoft.Phone.Info.DeviceExtendedProperties.GetValue("DeviceUniqueId");

问题是,两种方式都没有编译, 我不知道我错过了什么。 它说它在 WP8.1

中得到支持

这是我在文件顶部使用名称 space 时的错误:

using Microsoft.Phone.Info;

error CS0234: The type or namespace name 'Phone' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)

直接调用函数同样报错

Microsoft.Phone.Info.DeviceExtendedProperties.GetValue("DeviceUniqueId");

我找到了答案, 在对象浏览器中添加命名空间。

无论如何,谢谢大家的回答。