naps2
naps2 copied to clipboard
In windows 7 32-bit and 64-bit systems, scanner information cannot be found
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);
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.
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