Это код
private PosPrinter GetReceiptPrinter()
{
PosExplorer posExplorer = new PosExplorer();
DeviceInfo receiptPrinterDevice = posExplorer.GetDevice(DeviceType.PosPrinter, sPOSPrinterName);
return (PosPrinter)posExplorer.CreateInstance(receiptPrinterDevice);
}
Я получаю ошибку при переходе на следующую строку:
PosExplorer posExplorer = new PosExplorer();
Устройство печати моего чека: hp a798
Я уже добавил этот код в app.config
<runtime>
<NetFx40_LegacySecurityPolicy enabled="true" />
</runtime>
Согласно ДжонуЭто исключение:
Исключение System.TypeInitializationException не обработано. HResult = -2146233036
Сообщение = Инициализатор типа для Microsoft.PointOfService.Management.Explorer вызвал исключение.
Source = Microsoft.PointOfService
TypeName = Microsoft.PointOfService.Management.Explorer
StackTrace:
в Microsoft.PointOfService.Management.Explorer.CreateExplorer ()
в Microsoft.PointOfService.PosExplorer.LoadExplorer (at).PosExplorer.Initialize ()
в Microsoft.PointOfService.PosExplorer..ctor ()