输入'的初始值设定项;Microsoft.PointOfService.Management.Explorer';在现金抽屉的c#中引发了异常

输入'的初始值设定项;Microsoft.PointOfService.Management.Explorer';在现金抽屉的c#中引发了异常,c#,point-of-sale,C#,Point Of Sale,我是POS系统的新手,所以如果我遗漏了任何信息,请让我知道,我会用它进行编辑。 我已经通过安装程序在其他PC上安装了WINFORM,我想在加载表单时打开一个附带的现金抽屉。我使用了Microsoft.PointOfService dll。这是我的密码: public partial class CashRegister : Form { CashDrawer myCashDrawer; PosExplorer explorer; public CashRegis


我是POS系统的新手,所以如果我遗漏了任何信息,请让我知道,我会用它进行编辑。 我已经通过安装程序在其他PC上安装了WINFORM,我想在加载表单时打开一个附带的现金抽屉。我使用了Microsoft.PointOfService dll。这是我的密码:

  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();
    }
}
但当它执行时,会出现以下错误:

“Microsoft.PointOfService.Management.Explorer”的类型初始值设定项引发异常

有人能帮忙吗

谢谢

编辑:这是TypeInitializationException错误的详细信息

`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. ---> 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 ---

感谢大家,我已经修复了。对于.Net v1.12.exe,这只是一个愚蠢的misout.nstalled POS,它没有给出任何错误。

什么是内部异常?很抱歉,什么是内部异常。@user2454135:发布完整堆栈跟踪-尽可能多的信息。这可能包括至少两个“级别”的异常:TypeInitializationException和导致它的“内部”异常。我在另一台电脑上编写了上述代码,这台电脑上没有安装并下载microsoft.pointofservice dll的抽屉,它没有显示任何错误,但在另一台电脑上,它给出了TypeInitializationException错误,我是否也需要在其他电脑上安装dll?这可能意味着您缺少引用的程序集。检查以确保已部署所有正确的DLL。