C# ImageScanner.ScanFilesToFolderAsync随机抛出HRESULT 0xE8E2DD73

C# ImageScanner.ScanFilesToFolderAsync随机抛出HRESULT 0xE8E2DD73,c#,uwp,C#,Uwp,这是一个用于Windows 10的通用Windows平台(UWP)应用程序,用C#编写,其目的是使用以下类扫描文档: Windows.Devices.Scanners.ImageScanner 在这一行: // Scan API call to start scanning from the Feeder source of the scanner. ImageScannerScanResult isr = await myScanner.ScanFilesToFolderAsync(Imag

这是一个用于Windows 10的通用Windows平台(UWP)应用程序,用C#编写,其目的是使用以下类扫描文档:

Windows.Devices.Scanners.ImageScanner
在这一行:

// Scan API call to start scanning from the Feeder source of the scanner.
ImageScannerScanResult isr = await myScanner.ScanFilesToFolderAsync(ImageScannerScanSource.Feeder, folder);
我得到以下例外情况:

System.Exception: Exception from HRESULT: 0xE8E2DD73
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at MyProject.ScannerPage.<ScanToFolder>d__11.MoveNext()

您是否曾尝试在代码中添加“取消扫描”作业?是否有任何可能导致扫描仪出现故障?()是的,熊猫,我试过使用cancellationToken,结果也是一样。不管“取消扫描”,HRESULT都是随机抛出的,到目前为止,我唯一知道的信息是代码号(我还不知道这是什么意思)。因此,“是什么导致我的扫描仪出现故障”正是我想知道的。在获得制造商的支持后,我们得出结论,问题出在由Microsoft开发的WIA驱动程序中。所以,我要么需要WIA支持的扫描仪,要么需要ISIS或TWAIN的第三方库。你有没有尝试过在代码中添加“取消扫描”作业?是否有任何可能导致扫描仪出现故障?()是的,熊猫,我试过使用cancellationToken,结果也是一样。不管“取消扫描”,HRESULT都是随机抛出的,到目前为止,我唯一知道的信息是代码号(我还不知道这是什么意思)。因此,“是什么导致我的扫描仪出现故障”正是我想知道的。在获得制造商的支持后,我们得出结论,问题出在由Microsoft开发的WIA驱动程序中。所以,我要么需要WIA支持的扫描仪,要么需要ISIS或TWAIN的第三方库。
try
{
    // Get the scanner object for this device id
    ImageScanner myScanner = await ImageScanner.FromIdAsync(deviceId);

    // Check to see if the use has already cancelled the scenario
    if (model.ScenarioRunning)
    {
        if (myScanner.IsScanSourceSupported(ImageScannerScanSource.Feeder))
        {
            // Set MaxNumberOfPages to zero to scanning all the pages that are present in the feeder
            myScanner.FeederConfiguration.MaxNumberOfPages = 0;

            cancellationToken = new CancellationTokenSource();

            // Scan API call to start scanning from the Feeder source of the scanner.
            ImageScannerScanResult operation = await myScanner.ScanFilesToFolderAsync(ImageScannerScanSource.Feeder, folder);

            model.ScenarioRunning = false;
        }
        else
        {
            // The selected scanner does not have a Feeder
            model.ScenarioRunning = false;
        }
    }
}
catch (Exception ex)
{
    Utils.OnScenarioException(ex, model);
}