[Mono-bugs] [Bug 576480] New: SerialPort cannot open serial ports above COM9 on Windows

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Feb 3 07:03:01 EST 2010


http://bugzilla.novell.com/show_bug.cgi?id=576480

http://bugzilla.novell.com/show_bug.cgi?id=576480#c0


           Summary: SerialPort cannot open serial ports above COM9 on
                    Windows
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 1.2.4
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: System
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: shaundv at robonica.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


User-Agent:       Opera/9.80 (Windows NT 5.1; U; en) Presto/2.2.15
Version/10.10

To open serial ports above COM9, Windows expects the port name to be prefixed
with "\\.\". The PortName property of the Mono System.IO.SerialPort class
throws an ArgumentException if slashes are specified, but unless they are
specified, trying to open a port above COM9 causes Open() to throw an exception
saying that the port does not exist.

The Microsoft .NET implementation has the same check on the PortName property,
but it prefixes "\\.\" to the port name before passing it to CreateFile().



Reproducible: Always

Steps to Reproduce:
1. Ensure that the machine has something plugged into a serial port above COM9
(for this example I'm assuming COM11).
2. Create an instance of SerialPort. 
3. Set the PortName property to "COM11".
4. Call Open().
Actual Results:  
Open() throws an IOException saying that the port does not exist.

Expected Results:  
Open() should have succeeded.

I have confirmed this on Mono 1.2.4. From a glance at the source code it seems
that the bug still exists in the latest version, but I haven't confirmed it.

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list