Index: System/ChangeLog
===================================================================
--- System/ChangeLog	(revision 77992)
+++ System/ChangeLog	(working copy)
@@ -1,3 +1,12 @@
+2007-05-28  David Fergusion <davecferguson@gmail.com>
+
+	Fixes bug #77633
+	
+	* DateTime.cs: Changed DateTime.Parse() to throw a FormatException
+	  instead of an ArgumentOutOfRangeException for .NET 2.0.  An
+	  ArgumentOutOfRangeException is still thrown for .NET 1.1.  Added
+	  two unit tests to test for the scenario.
+
 2007-05-25  Jonathan Chambers  <joncham@gmail.com>
 
 	* __ComObject.cs: Add overload to GetInterface to allow
Index: System/DateTime.cs
===================================================================
--- System/DateTime.cs	(revision 77992)
+++ System/DateTime.cs	(working copy)
@@ -844,6 +844,10 @@
 			// but right now we don't support all the supported
 			// patterns for each culture, so try InvariantCulture
 			// as a quick remedy.
+			
+			const string formatExceptionMessage = "String was not recognized as a valid DateTime.";
+			const string argumentYearRangeExceptionMessage = "Valid values are between 1 and 9999, inclusive.";
+			
 			if (s == null)
 				throw new ArgumentNullException (Locale.GetText ("s is null"));
 			DateTime result;
@@ -866,12 +870,17 @@
 			if (ParseExact (s, commonFormats, DateTimeFormatInfo.InvariantInfo, styles, out result, false, ref longYear))
 				return result;
 
+#if NET_2_0
+			// .NET does not throw an ArgumentOutOfRangeException, but .NET 1.1 does.
+			throw new FormatException (formatExceptionMessage);
+#else
 			if (longYear) {
 				throw new ArgumentOutOfRangeException ("year",
-					"Valid values are between 1 and 9999 inclusive");
+					argumentYearRangeExceptionMessage);
 			}
 
-			throw new FormatException ("String was not recognized as a valid DateTime.");
+			throw new FormatException (formatExceptionMessage);
+#endif
 		}
 
 		public static DateTime ParseExact (string s, string format, IFormatProvider fp)
Index: Test/System/DateTimeTest.cs
===================================================================
--- Test/System/DateTimeTest.cs	(revision 77992)
+++ Test/System/DateTimeTest.cs	(working copy)
@@ -900,6 +900,37 @@
 	        IFormatProvider format = new CultureInfo("fr-FR", true);
 		DateTime t1 = DateTime.Parse(frDateTime, format);
 	}
+	
+	[Test]
+	[ExpectedException(typeof (ArgumentOutOfRangeException))]
+	public void ParseFormatExceptionForInvalidYearForNET11 ()
+	{
+		// Bug #77633.  In .NET 1..1, the expected exception is ArgumentOutOfRangeException
+#if NET_2_0
+		// throw the expected exception, this is not the version of .NET that this test is checking
+		throw new ArgumentOutOfRangeException ();
+#else
+		// build a string with the year
+		string s = "1/1/10000";
+		DateTime dt = DateTime.Parse (s);
+#endif
+	}
+	
+	[Test]
+	[ExpectedException(typeof (FormatException))]
+	public void ParseFormatExceptionForInvalidYearForNET20 ()
+	{
+		// Bug #77633.  In .NET 2.0, the expected exception is FormatException
+#if NET_2_0
+		
+		// build a string with the year
+		string s = "1/1/10000";
+		DateTime dt = DateTime.Parse (s);
+#else
+		// throw the expected exception, this is not the version of .NET that this test is checking
+		throw new FormatException ();
+#endif		
+	}
 
 	public void TestOA ()
 	{
