locked
POS - Using Blackcopper BC-85AC thermal Receipt Printer RRS feed

  • Question

  • Hey I am facing a little issue while accessing the POS printer I have configure it and send the Test Print It all working fine but when i tried to access it with the posExplorer.GetDevice(); I get Null value.
    and I have tried of adding the logical Name my command line but every time I get this two error.
    One is " POS -  No device is Found on this port  ".
    Second is " POS - NO device of this Name"

    help Me out Please its really Urgent

    Thursday, April 28, 2016 2:09 PM

Answers

  • Hi Hasham,

    Please try to add this to your app.config:

       <runtime>
          <NetFx40_LegacySecurityPolicy enabled="true"/>
        </runtime>

    And

    DeviceInfo receiptPrinterDevice = posExplorer.GetDevice(DeviceType.PosPrinter,"MYPRINTER");
    Reference:
    The type initializer for 'Microsoft.PointOfService.Management.Explorer' threw an exception

    Have a nice day!

    Kristin


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    • Edited by Kristin Xie Tuesday, May 3, 2016 1:27 AM
    • Proposed as answer by Kristin Xie Wednesday, May 4, 2016 8:21 AM
    • Marked as answer by DotNet Wang Friday, May 6, 2016 1:48 AM
    Tuesday, May 3, 2016 1:27 AM

All replies

  • Hi Hasham ,

    Have you checked this PosExplorer.GetDevice Method (String) in MSDN?

    Try GetDevices to see whether the device is in the collection. Maybe it is not defined in Configuration.xml

    There must be only one device of that type currently in the system, or if there is more than one, one must have been configured as the default device. If there is more than one device of the specified type and no device has been configured as the default device, an exception will be thrown.

    For more detailed information, please check above link in remarks section.

    Here I also found some similar threads like yours.

    OPOS PosExplorer.GetDevice() returns null in .net 4.5 environment?

    PosExplorer GetDevice returns null

    Op resolved this issue is that Epson drivers needed to be installed with administrator privileges to be able to modify the Configuration.xml file.

    Please also check if it helps you or not.

    Best regards,

    Kristin


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, April 29, 2016 6:36 AM
  • Hi Kristin,

    I have tried the GetDevices function i only get this one device related to POS and that is 
    Service Object Name: Microsoft PosPrinter Simulator
    Logical Names:
    Description: Simulated service object for Pos Printer
    Manufacturer: Microsoft Corporation
    Type: PosPrinter

     but it is just simulator i don't get my Printer that I have configure that is Black copper BC-85AC .
    You can guide me how to add itx logical name and when i try to add it my this way in my app-config file

    <PointOfServiceConfig Version="1.0">
    <ServiceObject Name="Microsoft PosPrinter Simulator" Type="PosPrinter">
        <Device HardwarePath="" Enabled="yes" PnP="no" Default="no">
          <LogicalName Name="my_device" />
        </Device>
      </ServiceObject>
    </PointOfServiceConfig>

    it threw an exception " The type initializer for 'Microsoft.PointOfService.Management.Explorer' threw an exception."


    Regards,
    Hasham


    Friday, April 29, 2016 11:56 AM
  • Hi Hasham,

    Please try to add this to your app.config:

       <runtime>
          <NetFx40_LegacySecurityPolicy enabled="true"/>
        </runtime>

    And

    DeviceInfo receiptPrinterDevice = posExplorer.GetDevice(DeviceType.PosPrinter,"MYPRINTER");
    Reference:
    The type initializer for 'Microsoft.PointOfService.Management.Explorer' threw an exception

    Have a nice day!

    Kristin


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    • Edited by Kristin Xie Tuesday, May 3, 2016 1:27 AM
    • Proposed as answer by Kristin Xie Wednesday, May 4, 2016 8:21 AM
    • Marked as answer by DotNet Wang Friday, May 6, 2016 1:48 AM
    Tuesday, May 3, 2016 1:27 AM