naps2 icon indicating copy to clipboard operation
naps2 copied to clipboard

In windows 7 32-bit and 64-bit systems, scanner information cannot be found

Open happycoderNo1 opened this issue 10 months ago • 2 comments

Hello, I have developed a winform program using NAPS2 SDK and try to invoke scanner using twain. It can work normally in windows10 and 11, but it can not work normally in Windows 7 64 and 32 bit environment. The specific performance is that it takes too long to obtain scanner list and no data is returned. The detailed code is as follows. Could you please give me some help?

ScanningContext scanningContext = new ScanningContext(new GdiImageContext());
var controller = new ScanController(scanningContext);

scanningContext.SetUpWin32Worker();

// Program blocking
List<ScanDevice> scanDevices = await scanController.GetDeviceList(Driver.Twain);

happycoderNo1 avatar Apr 15 '24 14:04 happycoderNo1

I should document this somewhere but I'm not going to officially support Windows 7 with the SDK. The problem is that the worker is built with net8 which doesn't support Win7.

cyanfish avatar Apr 15 '24 16:04 cyanfish

If you want you can build your own worker as mentioned here: https://github.com/cyanfish/naps2/blob/798fcaa1008b768dfd86a3a7b8ad8de131cf871a/NAPS2.Sdk.Samples/TwainSample.cs#L10-L17

cyanfish avatar Apr 16 '24 20:04 cyanfish