There is a local web application project that uses a scanner. When trying to connect to the hardware dll gives a connection error, i.e. The library connects correctly. Similar code in WinForm works correctly.

There are suspicions that the matter is in the IIS server settings. I listened to the usb port, when connecting through the correct application and with a successful connection, it is clear that no data is sent or received, the status is successful. Here is the code itself. Same as in WinForms and ASP.NET

[DllImport("Dll\\IDC-V\\ScanDll.dll")] public static extern int IO_HasScanner(string DeviceName, IntPtr Handle); IntPtr ptr = Marshal.AllocHGlobal(4); API_IDCV.iRet = IO_HasScanner("IDC_V", ptr); 

1 answer 1

Pool setting helped: Start Mode:AlwaysRunning