【发布时间】:2014-02-23 16:59:04
【问题描述】:
很抱歉,如果之前有人问过这个问题,但我无法在 Google 或 Bing 搜索中找到任何相关的 qns。
我正在构建一个带有 ASP.net 和 IIS 服务器收据打印的简单 POS 系统。我已经安装了 .net 1.12 的 OPOS 和 .net 的 epson OPOS,并且我已经将我的 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 项目的任何配置或错误编码?可能有一个编码示例会很有帮助。
干杯, 克里斯·辛
【问题讨论】:
标签: .net asp.net-mvc-4 c#-4.0 epson opos