[Mono-bugs] [Bug 42742][Nor] New - FormatterServices.GetSerializableMembers() and non serializable object
bugzilla-daemon@rocky.ximian.com
bugzilla-daemon@rocky.ximian.com
Sat, 10 May 2003 13:45:52 -0400 (EDT)
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 jean-marc.andre@polymtl.ca.
http://bugzilla.ximian.com/show_bug.cgi?id=42742
--- shadow/42742 Sat May 10 13:45:52 2003
+++ shadow/42742.tmp.24842 Sat May 10 13:45:52 2003
@@ -0,0 +1,72 @@
+Bug#: 42742
+Product: Mono/Class Libraries
+Version: unspecified
+OS: All
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: jean-marc.andre@polymtl.ca
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: FormatterServices.GetSerializableMembers() and non serializable object
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+
+FormatterServices.GetSerializableMembers() should throw a
+SerializationException when an object not marked with the [Serializable] is
+passed.
+
+Steps to reproduce the problem:
+1.
+
+using System;
+using System.Reflection;
+using System.Runtime.Serialization;
+
+public class NotSerializableClass: ISerializable {
+ public void GetObjectData(SerializationInfo info, StreamingContext context) {
+ }
+
+}
+
+public class MyClass {
+
+ public static void Main() {
+
+ try{
+
+ MemberInfo[] info =
+FormatterServices.GetSerializableMembers(typeof(NotSerializableClass));
+ }
+ catch(SerializationException e){
+ Console.WriteLine(e.Message);
+ }
+
+ }
+}
+
+
+2.
+3.
+
+Actual Results:
+not exception thrown
+
+
+Expected Results:
+a SerializationException is thrown
+
+
+How often does this happen?
+always
+
+
+Additional Information: