无法引用 UWP Windows.Devices.Portable

UWP Windows.Devices.Portable cannot be referenced

在我的 UWP 应用程序中,我正在尝试访问 便携式设备(MTP、PTP)存储。

在下面的问题中,OP 使用命名空间 Windows.Devices.Portable 没有问题。 .

但就我而言:

Windows.Devices 不包含 便携式 class

我设法弄明白了。命名空间 Windows.Devices.Portable 位于 UWP.

Windows 桌面扩展中

因此,您需要做的就是引用扩展程序。