writing Assembly information but Mono does not. This means that
serialized objects created on one platform are not able to be
deserialized on the other, thus preventing interoperability between .NET
and mono applications. Fixes the ObservableCollection part of bugzilla
11294.
Modifies ObjectReader so that when it encounters a primitive typed member in
an object stream which has no corresponding member in the app domain, it will
read the value anyway and throw it away. That way it can read the next block
from the stream.
Added a unit test which passes with the changes to ObjectReader.
Fixes bug #641821.
This commit includes unit tests that were run in MS.NET > 2.0.
The old behaviour of MS.NET 1.1 is still included in the patch
as an ONLY_1_1 define, to be backport-friendly to other branches
(but can be removed from now on in next commits, as mono master
doesn't include this profile anymore). Fixes BNC#324144.
* ObjectWriter.cs: Make the .ctor take a single BinaryFormatter
parameter and get the information from there. This should make
it easier to do some 4.0 new assignations, instead of adding yet
another parameter (also, ObjectReader is doing exactly what we
are doing here now).
* BinaryFormatter.cs:
* MessageFormatter.cs: Update call sites.
This set of .gitattributes was automatically generated from the list of files
that GIT tried to normalize when I enabled automatic EOL conversion.
With this set of attributes, we prevent automated EOL conversion on files that
we know will cause trouble down the road.
* ObjectReader.cs (ReadType, GetDeserializationType):
Add throwOnError parameter that specifies whether to throw an
exception if the type/assembly is not found.
* ObjectReader.cs (ReadTypeMetadata): Ignore unresolvable
types while reading the type info. Fixes#430583.
* ObjectReader.cs (GetDeserializationType): Rethrow caught
exceptions as SerializationExceptions.
svn path=/trunk/mcs/; revision=152579
* BinaryFormatter.cs: NoCheckDeserialize() was using PeekChar() on a
reader when it should only read 1 byte. Also BinaryReader.PeekChar()
tries to set the position of hte stream back to where it was before
the read, which does not work well with broken Stream
implementations like BZip2InputStream (reports CanSeek is true when
it really can't seek). Now we do a Read() and then pass the value we
read on to the next methods.
* MessageFormatter.cs:
* ObjectReader.cs: added overloads that take a BinaryElement instead
of reading it from the reader. Only for the methods used in
NoCheckDeserialize.
Fixes bug #503435.
svn path=/trunk/mcs/; revision=142963
* corlib_test.dll: Add S.R.S/SerializationTest2.cs
In System.Runtime.Serialization.Formatters.Binary:
2008-09-17 Robert Jordan <[email protected]>>
* ObjectReader.cs (ReadTypeMetadata): Replace the check for
ISerializable with something less `reflective'.
Fixes#421664.
In Test/System.Runtime.Serialization:
2008-09-17 Robert Jordan <[email protected]>
* SerializationTest2.cs: Add test case for bug #421664.
svn path=/trunk/mcs/; revision=113278
2007-08-25 Robert Jordan <[email protected]>
* DateTime.cs: Implement internal To/FromBinary for the 1.1 profile.
In System.Runtime.Serialization.Formatters.Binary:
2007-08-25 Robert Jordan <[email protected]>
* ObjectReader.cs, ObjectWriter.cs, CodeGenerator.cs:
Use DateTime.From/ToBinary. Fixes#82400.
svn path=/trunk/mcs/; revision=84839
2007-08-23 Robert Jordan <[email protected]>
* corlib.dll.sources: Added MemberInfoSerializationHolder.cs.
In System.Runtime.Serialization.Formatters.Binary:
2007-08-23 Robert Jordan <[email protected]>
* ObjectReader.cs, ObjectReader.cs: Map between System.MonoType[] and
MS.NET's System.RuntimeType[].
* ObjectReader.cs (ReadType): When a type couldn't be found, emit
a more useful exception.
In System.Reflection:
2007-08-23 Robert Jordan <[email protected]>
* MemberInfoSerializationHolder.cs: created from
ReflectionSerializationHolder to match MS (fixes bug #80761).
Add support for fields, events, properties and generic methods.
* MonoMethod.cs (GetObjectData): handle generic arguments.
* MonoGenericMethod.cs: mark as [Serializable].
* MonoProperty.cs (GetObjectData): implemented.
* MonoField.cs: ditto.
* MonoEvent.cs: ditto.
svn path=/trunk/mcs/; revision=84732
2006-12-25 Robert Jordan <[email protected]>
* MethodCall.cs: Add support for generic methods.
* MethodCall.cs (GetTypeNameFromAssemblyQualifiedName):
Add support for generic types.
* ReturnMessage.cs: Fix bug #80371.
In System.Runtime.Serialization.Formatters.Binary:
2006-12-25 Robert Jordan <[email protected]>
* binary_serialization_format.htm: Update the NET_2_0 format.
* BinaryCommon.cs: MethodFlags is actually an int32. Add NET_2_0 flags.
* MessageFormatter.cs: Add support for generic method arguments.
* ObjectWriter.cs, ObjectReader.cs: Map between System.MonoType and
MS.NET's System.RuntimeType.
svn path=/trunk/mcs/; revision=70683
Fix#79159
* ObjectWriter.cs (WritePrimitiveTypeArray) [NET_2_0]: Encode the
'Kind' of each DateTime.
* ObjectReader.cs (ReadArrayOfPrimitiveType) [NET_2_0]: Decode the
'Kind' of each DateTime.
In Test/System.Runtime.Serialization.Formatters.Binary:
* BinaryFormatterTest.cs (DateTimeArray): New test for
round-tripping DateTime arrays.
svn path=/trunk/mcs/; revision=64929
* BinaryFormatter.cs: Implemented UnsafeDeserialize and
UnsafeDeserializeMethodResponse methods. Fixes last TODO in this
namespace (for both 1.1 and 2.0 profiles).
svn path=/trunk/mcs/; revision=54045
* BinaryFormatter.cs: Added a demand for SerializationFormatter on
Serialize method (to make some CAS test work correctly).
svn path=/trunk/mcs/; revision=53770
Fix line endings of System/Decimal.cs (only actual "change" in text, to force recompile of mscorlib to reflect changes in decimal constant handling in the compiler)
svn path=/trunk/mcs/; revision=44558
* ObjectWriter.cs:
* CodeGenerator.cs: No need to add the class for inherited fields,
since FieldInfo objects returned by the GetSerializableMembers
method will already include the class name if needed.
svn path=/trunk/mcs/; revision=44268
* BinaryCommon.cs: Added helper method for swapping bytes.
* ObjectReader.cs:
* ObjectWriter.cs: Implemented serialization of arrays of primitive
types using Buffer.BlockCopy to create byffers of data that is written/
read in a single call. It's much faster now.
svn path=/trunk/mcs/; revision=42162
* BinaryCommon.cs: Found the meaning of two unknown binary elements.
* CodeGenerator.cs: Derive generated classes from ClrTypeMetadata
instead of TypeMetadata. Added writeTypes parameter to WriteTypeData().
* ObjectWriter.cs: Use type and assembly names as keys for the type and
assembly caches. This is needed since ISerializable types can provide
fake type names (which are mapped to real types by a binder on
deserialization).
Implemented support for BinaryFormatter.TypeFormat.
* BinaryFormatter.cs, MessageFormatter.cs: Implemented support for
TypeFormat property.
* ObjectReader.cs: Added support for objects serialized without
member type information. This fixes bug #73114.
If a binder return null, use the default way of loading the type.
svn path=/trunk/mcs/; revision=41404