问题描述
我正在尝试为Microsoft HoloLens开发条形码阅读器应用程序(使用本教程),但是我遇到了一个问题.在本教程的代码中,已引用System.Media.Capture.Frames
命名空间,似乎我缺少此命名空间.查看来自Microsoft的Windows通用示例,也被引用到该命名空间.但是,我无法导入此命名空间.
I'm trying to develop a barcode reader app for the Microsoft HoloLens (using this tutorial) but I'm encountering a problem. In the code of this tutorial, there's being referenced to the System.Media.Capture.Frames
namespace and it seems like I'm missing this namespace. Looking at the Windows universal samples from Microsoft, there's also being referenced to this namespace. However, I cannot import this namespace.
- 我正在Windows 10版本1607 Build 14393.693上运行
- 我有.NET Framework 4.6.2
- 我的Windows完全是最新的
有人知道我如何获得对这个名称空间的访问权吗?
Does anyone have any idea how I can get access to this namespace?
推荐答案
两个可能的问题:
-
您需要Windows.Media.Capture.Frames而不是System.Media.Capture.Frames
You need Windows.Media.Capture.Frames not System.Media.Capture.Frames
Windows.Media.Capture.Frames是内部版本14393的新功能,因此您需要确保您的应用程序至少定位于该目标:
Windows.Media.Capture.Frames is new for build 14393 so you'll need to make sure your app targets at least that high:
转到应用程序的项目属性,并确保在应用程序"选项卡上将目标版本设置为"Build 14393".或者,在文本或XML编辑器中打开csproj,然后在其中设置TargetPlatformVersion:
Go to your app's project properties and make sure your target version is set to Build 14393 on the Application tab. Alternatively open the csproj in a text or XML editor and set the TargetPlatformVersion there:
<TargetPlatformVersion>10.0.14393.0</TargetPlatformVersion>
如果您的最低版本低于14393,请确保使用 ApiInformation 类,然后再调用Frames函数以确保它们存在.
If your minimum version is less than 14393 then make sure you do feature detection with the ApiInformation class before calling the Frames functions to make sure they exist.
这篇关于缺少System.Media.Capture.Frames命名空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!