我正在开发销售点(POS)应用程序在Visual Studio 2017企业版上。目标框架是.NET框架4.5,我已经安装了Microsoft POS用于.NET 1.12(OPOS),我能够用得到的MSR读卡器:.NET 4.5上的CAS策略与Microsoft.PointOfService
PosExplorer myPosExplorer = new PosExplorer();
到目前为止,它是在直到今天运行的大早上安装True Key Intel后,我开始了POS与此错误获取MSR读卡器时崩溃:
the type initializer for microsoft.pointofservice.management.explorer threw an exception.
System.notsupportedexception: this method explicitly uses CAS policy, which has been obsoleted by the .NET framework. In order to enable cas policy for compatibility reasons, please use the newfx40_legacysecuritypolicy configuration switch. please see http://go.microsoft.com/fwlink/?LinkID=155570 for mor information. at system.securitymanager.resolvepolicy(evidence evedence) at microsoft.pointofservice.management.explorer.scanforsoassemblies()
我从来没有遇到这个错误之前,所以我就开始在网络上搜索,我发现这个page。它基本上说OPOS不支持.NET 4.0(我不使用!!!)
我使用Git,所以我回滚到以前版本的代码,并没有运气。我使用新的Visual Studio在新的Windows上运行POS,问题仍然存在。
OPOS有什么问题?我是否缺少一些注册表配置? 为什么这会一直告诉我关于CAS策略,当它放在.NET 4.0上并且我正在使用.NET 4.5时? 有没有其他更好的方法来控制MSR阅读器,打印机,线路显示器等外设?