【问题标题】:Picking image from picture folder - "The drive cannot locate a specific area or track on the disk."从图片文件夹中选取图像 - “驱动器无法找到磁盘上的特定区域或轨道。”
【发布时间】:2015-11-02 12:40:04
【问题描述】:

我正在用 C# 制作一个 UWP 应用程序,用户可以在其中选择拍照或使用现有的照片。使用此代码打开图像选择器

            FileOpenPicker picker = new FileOpenPicker();
            picker.SuggestedStartLocation =    PickerLocationId.PicturesLibrary;
            picker.FileTypeFilter.Add(".jpg");
            picker.FileTypeFilter.Add(".jpeg");
            picker.FileTypeFilter.Add(".png");
            StorageFile file = await picker.PickSingleFileAsync();

在物理设备上我得到这个异常:

Exception thrown: 'System.Exception' in mscorlib.ni.dll
The drive cannot locate a specific area or track on the disk. (Exception from HRESULT: 0x80070019)

奇怪的是,我在任何模拟器上都没有遇到异常,而且它过去也可以在物理设备上工作。有什么建议或解释吗?

【问题讨论】:

  • 尝试从设备上手动卸载应用程序并重新部署。看看会发生什么。
  • 不幸的是,这并没有改变。还有其他建议吗?
  • 可能是基于 msdn.microsoft.com/en-us/library/ms837466.aspx 的硬件问题。但是有人通过出厂重置手机解决了这个问题。如果有的话,我认为你可以更换 SD 卡。
  • 我会尝试恢复出厂设置,因为它是一个全新的设备,但你永远不知道。如果这不起作用,我会尝试使用新的 SD 卡,但非常感谢您的帮助!

标签: c# image mobile camera uwp


【解决方案1】:

【讨论】:

  • 虽然此链接可能会回答问题,但最好在此处包含答案的基本部分并提供链接以供参考。如果链接页面发生更改,仅链接的答案可能会失效。
【解决方案2】:

您可能需要检查您的 Properties\WMAppManifest.xml 文件。确保那里的元数据正确。例如,检查 Type 属性是否正确(以下示例中的“badabumm.ScheduledAgent”)。

<Tasks>      
    <DefaultTask Name="_default" NavigationPage="badabumm.xaml" />
    <ExtendedTask Name="BackgroundTask">
            <BackgroundServiceAgent Specifier="ScheduledTaskAgent" Name="badabumm Agent" Source="badabumm Agent" Type="badabumm.ScheduledAgent" />
    </ExtendedTask>
</Tasks>

这个解决方案最初是在这个source中提出的。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2010-10-12
    • 1970-01-01
    • 2014-05-30
    • 1970-01-01
    • 2015-12-14
    • 2018-02-18
    • 1970-01-01
    相关资源
    最近更新 更多