0

これが以前に尋ねられた場合は申し訳ありませんが、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 プロジェクトの構成や間違ったコーディングを見逃していませんか? コーディング例があると非常に役立ちます。

乾杯、クリス・シム

4

1 に答える 1

0

あなたが試すことができること: exception?forum=posfordotnet

<configuration>
  <runtime>
   <NetFx40_LegacySecurityPolicy enabled="true"/>
  </runtime>
</configuration>
  1. アプリケーション プールを 32 ビット モードで実行していることを確認します
  2. アプリケーションの bin フォルダーにすべての DLL (Microsoft.PointOfService.ControlBase.dll と Microsoft.PointOfService.dll など) があることを確認します。
  3. 制限されたユーザーでアプリケーション プールを実行している場合は、より高いアクセス レベルのユーザー アカウントで実行してみてください
于 2014-02-10T15:15:18.003 に答える