title: Hang on Open()/Claim() in OPOS / POS for .NET
body: <p>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. </p>
  
  <p>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.</p>
  
  <p>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:</p>
  
  <p>Issue 1)</p>
  
  <p>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.</p>
  
  <ol>
  <li>Symbol control object-OCX c:\WINDOWS\system32\scanner.ocx</li>
  <li>Service Object-DLL c:\WINDOWS\system32\stiopos.dll</li>
  </ol>
  
  <p>Issue 2)</p>
  
  <p>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. </p>
  
  <p>Notes:</p>
  
  <ol>
  <li>IIS is now running as SYSTEM in my tests - it makes no difference.</li>
  <li>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. </li>
  <li>The application uses c:\program files\OPOS\CommonCO\OPOSCashDrawer.ocx and c:\program files\OPOS\Epson2\SoDrw14.dll</li>
  </ol>
  
  <p>Have you ever seen this behaviour? Do you have any suggestions on how to solve it?</p>
  
  <p>Stack trace when hangs:</p>
  
  <pre><code>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    
  </code></pre>