The code snippet below works in prod but not in my development environment. I kept getting an error - "Unable to determine printer type". I checked out a prior version from GitHub and that app worked fine with the same code.
The fix was to rollback these libraries. I am sure it is probably just one of them, but this fixed my issue:
- FluentFTP (19.2.2)
- BoucyCastle (1.8.2)
- SharpSnmpLib (10.0.9)
These are dependecies of Zebra.Printer.SDK.
Connect to a network printer:
ZebraCardPrinter zebraCardPrinter = null;
IPHostEntry hostEntry = Dns.GetHostEntry(drvName);
var ip = hostEntry.AddressList;
connection = new Zebra.Sdk.Comm.TcpConnection(ip.MapToIPv4().ToString(), 9100);
zebraCardPrinter = ZebraCardPrinterFactory.GetInstance(connection);