2003-05-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
authorGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Sun, 11 May 2003 01:58:21 +0000 (01:58 -0000)
committerGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Sun, 11 May 2003 01:58:21 +0000 (01:58 -0000)
* FormatterServices.cs: patch from Jean Marc that fixes bug #42742.

svn path=/trunk/mcs/; revision=14473

mcs/class/corlib/System.Runtime.Serialization/ChangeLog
mcs/class/corlib/System.Runtime.Serialization/FormatterServices.cs

index 7d9a8c375fb517d1e33c191108713d3b760e8ac0..0d6d4b0a1a9b4e2e54b67208f0b0d0ba3ade7672 100644 (file)
@@ -1,3 +1,7 @@
+2003-05-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+       * FormatterServices.cs: patch from Jean Marc that fixes bug #42742.
+
 2003-02-18  Lluis Sanchez Gual  <lluis@ideary.com>
 
        * ObjectManager.cs: Corrected a problem with arrays of structs. Elements where
index 6243e88d59b5fd12fba96402b3c7c4e8fccd1a16..5ec537b5e53ecf6f93441ed7fd63444021112875 100644 (file)
@@ -61,6 +61,12 @@ namespace System.Runtime.Serialization
                        if (type == null)
                                throw new ArgumentNullException ("type");
 
+                       if (!type.IsSerializable) {
+                               string msg = String.Format ("Type {0} in assembly {1} is not marked as serializable.",
+                                                           type, type.Assembly.FullName);
+                               throw new SerializationException (msg);
+                       }
+
                        //FIXME: context?
                        ArrayList fields = new ArrayList ();
                        Type t = type;