SerialPort.Open requiring elevated privs on Vista?

D

David Hearn

(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
 
D

David Hearn

David said:
(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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top