SerialPort.Open requiring elevated privs on Vista?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • David Hearn

    SerialPort.Open requiring elevated privs on Vista?

    (Apologies if this is not the appropriate group)

    I'm trying to use an external USRobotics USB modem (Model 5633B) in
    Vista - and talk to it via AT commands from my C# application (using
    VS2008 + .Net 2.0). Downloaded the Vista drivers, and it comes up as
    COM12. I also have a built-in modem in this laptop (COM3).

    I started off using CRT4 (old terminal app like Hyperterm) and can open
    and use both the modems, sending AT commands to either without issue.
    CRT is run as standard user (and was written well before Vista was
    available).

    I now try to open COM12 in my app and it's failing at the
    SerialPort.Open ("COM12") method call saying "The port 'COM12' does not
    exist". Doing it with COM3 works.

    However, when I accidentally ran my app elevated (elevated VS2008 for
    another reason and then forgot) my app could open COM12.

    I tried Hyperterm with COM12 and it gives a similar error to my app -
    running elevated as Administrator makes it work. I'm not sure how CRT
    can open COM12 then, if other apps require elevation to do it.

    Can anyone explain what might be causing a specific COM port to require
    elevated privs to be opened? I've tried enabling and disabling
    Virtualisation for my app, but it makes no difference.

    Any thoughts?

    Thanks

    David
  • David Hearn

    #2
    Re: SerialPort.Open requiring elevated privs on Vista?

    David Hearn wrote:
    (Apologies if this is not the appropriate group)
    >
    I'm trying to use an external USRobotics USB modem (Model 5633B) in
    Vista - and talk to it via AT commands from my C# application (using
    VS2008 + .Net 2.0). Downloaded the Vista drivers, and it comes up as
    COM12. I also have a built-in modem in this laptop (COM3).
    >
    I started off using CRT4 (old terminal app like Hyperterm) and can open
    and use both the modems, sending AT commands to either without issue.
    CRT is run as standard user (and was written well before Vista was
    available).
    >
    I now try to open COM12 in my app and it's failing at the
    SerialPort.Open ("COM12") method call saying "The port 'COM12' does not
    exist". Doing it with COM3 works.
    >
    However, when I accidentally ran my app elevated (elevated VS2008 for
    another reason and then forgot) my app could open COM12.
    >
    I tried Hyperterm with COM12 and it gives a similar error to my app -
    running elevated as Administrator makes it work. I'm not sure how CRT
    can open COM12 then, if other apps require elevation to do it.
    >
    Can anyone explain what might be causing a specific COM port to require
    elevated privs to be opened? I've tried enabling and disabling
    Virtualisation for my app, but it makes no difference.
    >
    Any thoughts?
    >
    Thanks
    >
    David
    Bizarrely, a reboot sorted it.

    D

    Comment

    Working...