首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >带asp.net的OPOS

带asp.net的OPOS
EN

Stack Overflow用户
提问于 2014-01-31 04:50:41
回答 1查看 1.6K关注 0票数 0

很抱歉,如果这是之前的问题,但我没有找到任何相关的qns在谷歌或必应搜索。

我正在构建一个简单的POS系统,使用ASP.net & IIS收据打印。我已经为.net 1.12安装了OPOS,为.net安装了epson OPOS,我还包括了对我的ASP.net项目的参考。但是,我似乎无法传递以下代码的“();”。

代码语言:javascript
复制
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);

我得到的错误是

代码语言:javascript
复制
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.

我可以通过添加C#桌面项目使代码在app.config中工作。

我是否遗漏了ASP.net项目的任何配置或错误的编码?可能有一个编码例子将是很大的帮助。

干杯,克里斯·辛

EN

回答 1

Stack Overflow用户

发布于 2014-02-10 15:15:18

你可以尝试的东西: 1.来自http://social.msdn.microsoft.com/Forums/en-US/33e98f0d-04b2-4dd2-bbd4-8237610f0728/the-type-initializer-for-microsoftpointofservicemanagementexplorer-threw-an-exception?forum=posfordotnet

代码语言:javascript
复制
<configuration>
  <runtime>
   <NetFx40_LegacySecurityPolicy enabled="true"/>
  </runtime>
</configuration>
  1. 确保以32位模式运行应用程序池。
  2. 确保应用程序的bin文件夹中有所有all (Microsoft.PointOfService.ControlBase.dll和Microsoft.PointOfService.dll以及其他all)
  3. 如果使用受限用户运行应用程序池,请尝试使用访问级别较高的用户帐户运行应用程序池。
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/21472615

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档