none
SerialPort class not working for passthrough'ed serialports in remote-desktop sessions RRS feed

  • Question

  • Hi,

    I'm trying to use SerialPort class to communicate via serial port in an remote desktop session.

    The serial port is the "local COM port" which is passed through to the RDP session (RDP host-system is Win2k8R2 64bit, but also tried Win764bit).

    Unfortunately it does not work, I get an argument exception when opening the port.

    "The given port name is invalid. It may be a valid port but not a serial port...."

    Anybody has some input on myy SerialPort&RDP problem?

    Thanks

    Johannes

    Friday, May 11, 2012 2:30 PM

Answers

All replies

  • Please use this BCL forum for asking the IO aspect question: http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/threads

    Mike Zhang[MSFT]
    MSDN Community Support | Feedback to us

    Monday, May 14, 2012 4:11 AM
    Moderator
  • Monday, May 14, 2012 4:44 AM
  • Thanks for the input.

    I have some additional info, which I should have included in the initial post:

    - Using native API seems to work (at least CreateFile returns a valid handle)

    - Using Putty as test-program works too.

    - Client PC is a HP-ThinPro (native system is some ubuntu linux)

    - Terminal servers tested: Win2k8R2 64bit, Win 2003, my own local Win7-64bit. They all didn't work (all with the exception "not a valid port", 2003 with no exception, program just crashed without error-message after about 1 minute)

    Greetings

    Johannes

    Monday, May 14, 2012 6:25 AM
  • More Info:

    - Native Win32 Api not working either. I get a BadImageFormatException (Marshal.ThrowExceptionForHR), HRESULT is 0x80070570)

    - HP ThinPro seems to use application "rdesktop" for rdp-connection.

    - I used rdesktop directly, same result.

    Anybody?!

    Monday, May 14, 2012 10:49 AM
  • Even more info:

    - I tried the following in a command-shell:

    "type COM3"

    which works fine on my local PC.

    If I do this in Remote-Desktop-Session i get the following error:

    "The file or directory is corrupted and unreadable"

    Greetings

    Johannes

    P.S.:

    Same scenario tested with "mstsc.exe" (windows remote-desktop client) WORKS.

    So - rdesktop (linux's opensource RDP-clíent is to blame, at least the version HP used)


    Monday, May 14, 2012 10:58 AM
  • You may want to take a look on this thread.
    Tuesday, May 15, 2012 2:33 AM
    Answerer
  • In the end, it was some settings/scripts, that had to be configured/run on the thin-client.

    Currently I don't know what exactly had to be done, will receive information from the administrator later.

    Thanks

    Johannes

    Thursday, May 31, 2012 6:22 AM
  • In the end, it was some settings/scripts, that had to be configured/run on the thin-client.

    Currently I don't know what exactly had to be done, will receive information from the administrator later.

    Thanks

    Johannes

    Oh, could you please tell me what did you do exactly? What settings should be set on Thin clients? I'm faced now with absolutely the same problem (thin clients, rdesktop and incomplete COM port mapping) and don't know what to do.
    Tuesday, February 12, 2013 2:23 AM