Hang on Open()/Claim() in OPOS / POS for .NET
I am running Microsoft POS for .NET. I have a cash drawer, barcode scanner and receipt printer connected to the computer. Using the Microsoft POS for .NET test application, they all work fine.
Our application is an ASP.NET web application, in IIS. We thus instantiate the OPOS devices from the server-side of the web application, and everything works fine. We've been doing this since Windows XP / IIS 5.1.
We're now upgrading our deployment computers to Windows 7. Our development computers run this scenario without issue. However, on the deployment computer I am currently working with, I have had two issues:
Issue 1)
The barcode scanner hangs on the Open() method. It freezes there and never terminates. I discovered that if I changed the permissions (full access to everyone) on the following files, the scanner would start working.
- Symbol control object-OCX c:\WINDOWS\system32\scanner.ocx
- Service Object-DLL c:\WINDOWS\system32\stiopos.dll
Issue 2)
The cash drawer is now presenting similar behaviour: it freezes on the Claim() method. I have changed permissions on all the files I could find (even loading up sysinternal's Process Explorer) to find which files were in use. This has not solved the problem.
Notes:
- IIS is now running as SYSTEM in my tests - it makes no difference.
- The hardware works fine in Epson OPOS and the Microsoft POS for .NET test tool. Therefore, the issue is only when running within the context of a web application.
- The application uses c:\program files\OPOS\CommonCO\OPOSCashDrawer.ocx and c:\program files\开发者_JS百科OPOS\Epson2\SoDrw14.dll
Have you ever seen this behaviour? Do you have any suggestions on how to solve it?
Stack trace when hangs:
Microsoft.PointOfService.dll!Microsoft.PointOfService.Legacy.LegacyProxy.InvokeMethod(string methodName = "ClaimDevice", ref object[] parameters, bool[] byRef) + 0x94 bytes
Microsoft.PointOfService.dll!Microsoft.PointOfService.Legacy.LegacyProxy.InvokeMethodAndCheckImpl(string methodName = "ClaimDevice", ref object[] parameters, bool[] byRef) + 0x50 bytes
Microsoft.PointOfService.dll!Microsoft.PointOfService.Legacy.LegacyProxy.Claim(int timeout) + 0x54 bytes
Microsoft.PointOfService.dll!Microsoft.PointOfService.Legacy.LegacyCashDrawer.Claim(int timeout) + 0xd bytes
Solution: Switch the app pool to Classic mode (instead of Integrated). It works like a charm now!
精彩评论