X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2Fcorlib%2FSystem.Runtime.Serialization.Formatters.Binary%2FObjectWriter.cs;h=b21a617bb341c0dcd41457df68ac35331eb246be;hb=9e3370d3351358044231dd1f3df5fff3720bdcc2;hp=11f382914cc9a9b64365dce8e9c363e6210f92d9;hpb=e5aa23189bfdb75e36528e491537ec26ca0fc0c0;p=mono.git diff --git a/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ObjectWriter.cs b/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ObjectWriter.cs index 11f382914cc..b21a617bb34 100644 --- a/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ObjectWriter.cs +++ b/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ObjectWriter.cs @@ -357,10 +357,7 @@ namespace System.Runtime.Serialization.Formatters.Binary // Check if the object is marked with the Serializable attribute - if (!instanceType.IsSerializable) - throw new SerializationException ("Type " + instanceType + - " is not marked as Serializable " + - "and does not implement ISerializable."); + BinaryCommon.CheckSerializable (instanceType, _surrogateSelector, _context); ISerializable ser = obj as ISerializable; @@ -653,6 +650,7 @@ namespace System.Runtime.Serialization.Formatters.Binary { if (val == null) { + BinaryCommon.CheckSerializable (valueType, _surrogateSelector, _context); writer.Write ((byte) BinaryElement.NullValue); } else if (BinaryCommon.IsPrimitive(val.GetType()))