[Mono-bugs] [Bug 77894][Nor] New - System.IO.Ports.StopBits Enumeration - value was out of legal range

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri Mar 24 04:49:52 EST 2006


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by vktgz at linuxmail.org.

http://bugzilla.ximian.com/show_bug.cgi?id=77894

--- shadow/77894	2006-03-24 04:49:52.000000000 -0500
+++ shadow/77894.tmp.19497	2006-03-24 04:49:52.000000000 -0500
@@ -0,0 +1,98 @@
+Bug#: 77894
+Product: Mono: Class Libraries
+Version: 1.1
+OS: other
+OS Details: win2k
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: System
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: vktgz at linuxmail.org               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: System.IO.Ports.StopBits Enumeration - value was out of legal range
+
+Description of Problem:
+try to open SerialPort with stop bits set to StopBits.One
+compile code with gmcs and run it with mono and with ms.net
+when run on mono there is no error
+when run on ms.net there is value out of legal range exception
+
+code:
+using System;
+
+using System.IO.Ports;
+
+
+
+namespace bugtest
+
+{
+
+	public class btest1
+
+	{
+
+		public static void Main(string[] args)
+
+		{
+
+			SerialPort com=new SerialPort("COM1", 9600, Parity.None, 8, StopBits.One);
+
+			try
+
+			{
+
+				com.Open();
+
+			}
+
+			catch {}
+
+			Console.WriteLine("No error");
+
+		}
+
+	}
+
+}
+
+
+Steps to reproduce the problem:
+1. gmcs btest1.cs
+2. mono btest1.exe
+3. btest1.exe
+
+Actual Results:
+mono: No error
+ms.net:
+
+Unhandled Exception: System.ArgumentOutOfRangeException: Enum value was out
+of legal range.
+
+Parameter name: StopBits
+
+   at System.IO.Ports.SerialPort.set_StopBits(StopBits value)
+
+   at System.IO.Ports.SerialPort..ctor(String portName, Int32 baudRate,
+Parity parity, Int32 dataBits, StopBits stopBits)
+
+   at bugtest.btest1.Main(String[] args)
+
+
+Expected Results:
+No error on both platforms
+
+How often does this happen? 
+always
+
+Additional Information:
+compile code with csc and run it with mono and with ms.net - there is no
+error on both platforms
+change StopBits.One to StopBits.Two, compile with gmcs and csc - no error
+on both platforms
+tested with Mono-1.1.3.4 and ms.net 2.0 on win2k


More information about the mono-bugs mailing list