title: type initializer for 'Microsoft.PointOfService.Management.Explorer' threw an exception in c# for cash drawer
body: <p><br>
  I am new in POS system, so if I miss out any info let me know will edit with it.
  I have installed a WINFORM on other PC through setup, and I want top open a cash drawer attached to it on form load. I have used Microsoft.PointOfService dll. And heres my code :</p>
  
  <pre><code>  public partial class CashRegister : Form
  {
  
  
      CashDrawer myCashDrawer;
      PosExplorer explorer;
  
      public CashRegister()
      {
          InitializeComponent();
          explorer = new Microsoft.PointOfService.PosExplorer();
          DeviceInfo ObjDevicesInfo = explorer.GetDevice("CashDrawer", "EP-125k");
          //myCashDrawer = (CashDrawer) explorer.CreateInstance(ObjDevicesInfo);
         // myCashDrawer.OpenDrawer();
      }
      public void OpenCashDrawer()
      {
          myCashDrawer.Open();
          myCashDrawer.Claim(1000);
          myCashDrawer.DeviceEnabled = true;
          myCashDrawer.OpenDrawer();
          myCashDrawer.DeviceEnabled = false;
          myCashDrawer.Release();
          myCashDrawer.Close();
      }
  
      private void button1_Click(object sender, EventArgs e)
      {
          this.Close();
      }
  
      private void CashRegister_Load(object sender, EventArgs e)
      {
        //  myCashDrawer.OpenDrawer();
      }
  }
  </code></pre>
  
  <p>But when it executes it gives following error:</p>
  
  <blockquote>
    <p>type initializer for 'Microsoft.PointOfService.Management.Explorer' threw an exception</p>
  </blockquote>
  
  <p>Can any one help.</p>
  
  <p>Thanks</p>
  
  <p>EDIT : this is the TypeInitializationException error's details</p>
  
  <pre><code>`See the end of this message for details on invoking 
   just-in-time (JIT) debugging instead of this dialog box.
  
  ************** Exception Text **************
  System.TypeInitializationException: The type initializer for          'Microsoft.PointOfService.Management.Explorer' threw an exception. ---&gt; Microsoft.PointOfService.PosLibraryException: Failed to open registry key HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\POSfor.NET\ControlAssemblies.
     at Microsoft.PointOfService.Management.AssemblyLoader.Scan()
     at Microsoft.PointOfService.Management.AssemblyLoader.Scan()
     at Microsoft.PointOfService.Management.Explorer.ScanForSOAssemblies()
     at Microsoft.PointOfService.Management.Explorer.Refresh()
     at Microsoft.PointOfService.Management.Explorer..ctor()
     at Microsoft.PointOfService.Management.Explorer..cctor()
     --- End of inner exception stack trace ---
  </code></pre>