これが以前に尋ねられた場合は申し訳ありませんが、Google または Bing 検索でこれに関連する QN を見つけることができませんでした。
ASP.net と IIS サーバーのレシート印刷を使用して、単純な POS システムを構築しています。OPOS for .net 1.12 と epson OPOS for .net をインストールし、ASP.net プロジェクトへの参照として含めました。しかし、「new PosExplorer();」を渡すことができないようです。次のコードの。
PosExplorer posExplorer = new PosExplorer();
DeviceInfo receiptPrinterDevice = posExplorer.GetDevice(DeviceType.PosPrinter);//posExplorer.GetDevice("PosPrinter", "ReceiptPrinter"); //May need to change this if you don't use a logicial name or use a different one.
return (PosPrinter)posExplorer.CreateInstance(receiptPrinterDevice);
私が得たエラーは
An exception of type 'System.TypeInitializationException' occurred in Microsoft.PointOfService.dll but was not handled in user code
Additional information: The type initializer for 'Microsoft.PointOfService.Management.Explorer' threw an exception.
app.config を追加することで、C# デスクトップ プロジェクトでコードを動作させることができます。
ASP.net プロジェクトの構成や間違ったコーディングを見逃していませんか? コーディング例があると非常に役立ちます。
乾杯、クリス・シム