I am working on a Point Of Sale (POS) app on Visual Studio 2017 enterprise edition. The target framework is .NET framework 4.5, I have installed Microsoft POS for .NET 1.12 (OPOS) and I was able to get the MSR card reader with:
PosExplorer myPosExplorer = new PosExplorer();
So far it was running great until today in the morning after installing True Key Intel, my POS started to crash when getting the MSR reader with this error:
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()
I had never faced this error before, so i started to search on the web and i found this page. It basically says OPOS is not supported for .NET 4.0 (Which i am not using!!!)
I am using Git, so i rolled back to a previous version of the code and have no luck. I run the POS on a new Windows with a new Visual Studio and the problem stills there.
What is it wrong with OPOS? Am i missing some registry configuration? Why does this keep telling me about CAS policy when it was dropped on .NET 4.0 and I am using .NET 4.5? Is there any other better way to control peripherals like MSR readers, printers, line displays, etc. ?