Commit Graph
97 Commits
Author SHA1 Message Date
Marek Safar 3fe85ac027 Revert "Merge pull request #615 from nealef/master"
This reverts commit ce6acbe4db, reversing
changes made to 7f0328f12a.
2013-04-29 11:25:17 +02:00
Neale 828a6a4f45 Fix incompatibility with .NET's serialization of ObservableCollection - part of bug 11294 2013-04-18 11:25:03 -04:00
Neale 61b6b3f0b6 Reverse patches that should have gone to my fork rather than to head 2013-04-18 11:23:35 -04:00
Neale f19a364025 When .NET serializes it will use the TypeForwardedFrom information when
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.
2013-04-16 22:27:47 -04:00
Rodrigo Kumpera b96d05dac3 Kill the MOONLIGHT define in corlib. 2013-02-11 16:03:28 -05:00
Rodrigo Kumpera eda3100573 Disable code generation for object serialization under Full AOT. 2012-11-06 18:18:15 -05:00
Martin Baulig ab016b57c9 [#5935][BinaryFormatter]: Fix serialization of generic arrays. 2012-09-18 21:22:18 +02:00
Miguel de Icaza ae0feab435 Removal of NET_1_1 defines and some NET_2_0; Both defines are true these days in Mono, no versions prior to 2.0 are supported 2012-06-01 18:04:24 -04:00
Lucas Meijer 0c3c72ad7d some documentation on DefaultSurrogateSelector 2011-03-20 10:58:08 -04:00
Lucas Meijer 3937ca55e7 Implmement a private BinaryFormatter.DefaultSurrogateSelector, which enables embedders who want to make a sandbox, to specify a default surrogate selector, which is required to get System.Serialization be able to operate within a CoreCLR environment. 2011-03-14 17:33:04 -04:00
Kyle Ambroff 0dfe460dc6 version tolerant serialization fails with missing primitive members
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.
2011-01-26 18:07:31 -05:00
Gonzalo Paniagua Javier a171f3314b Able to read MS serialized nullable<primitive>
Handle boxed primitive types for nullable fields.
	Fixes bug #646556.
2010-10-20 01:36:46 -04:00
Andrés G. Aragoneses bbd182a095 [corlib] Prevent BinaryFormatter to throw on missing fields
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.
2010-09-22 03:09:17 +08:00
Carlos Alberto Cortez 082626b239 Actually make use of SerializationBinder.BindToName for BinaryFormatter.
* ObjectWriter.cs: Actually take SerializationBinder.BindToName
	into account when serializing data.
2010-08-30 23:59:37 +02:00
Carlos Alberto Cortez e95ea2b4b3 Simplify the ObjectWriter .ctor and update call sites.
* 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.
2010-08-23 07:30:40 +02:00
Raja R Harinath b293948fb7 EOL handling
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.
2010-07-25 20:17:39 +05:30
Jb Evain e1b7f59d45 use MOONLIGHT symbol
svn path=/trunk/mcs/; revision=153669
2010-03-16 12:24:55 +00:00
Robert Jordan 6ffb4366fc 2010-02-26 Robert Jordan <[email protected]>
* 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
2010-02-26 20:24:43 +00:00
Miguel de Icaza 3c39ac4586 Jumbo patch for NET_2_0, mscorlib is now clean
svn path=/trunk/mcs/; revision=145621
2009-11-06 22:23:59 +00:00
Sebastien Pouliot 7b1f661862 2009-10-31 Sebastien Pouliot <[email protected]>
* BinaryCommon.cs: Disable MONO_REFLECTION_SERIALIZER override 
	for Moonlight plugin.


svn path=/trunk/mcs/; revision=145147
2009-10-31 16:19:24 +00:00
Gonzalo Paniagua Javier 34a842f6b3 2009-09-30 Gonzalo Paniagua Javier <[email protected]>
* 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
2009-09-30 06:06:06 +00:00
Zoltan Varga 2813a09b59 2009-03-29 Zoltan Varga <[email protected]>
* CodeGenerator.cs: Add synchronization as SRE is not thread safe.

svn path=/trunk/mcs/; revision=130484
2009-03-29 02:29:29 +00:00
Robert Jordan 3b1eaca759 2008-09-04 Robert Jordan <[email protected]>
* 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
2008-09-17 11:28:51 +00:00
Marek Safar cc9c53a109 Warnings cleanup
svn path=/trunk/mcs/; revision=111713
2008-08-27 15:40:13 +00:00
Andreas N 1e390b907f 2008-06-27 Andreas Nahr <[email protected]>
* BinaryFormatter.cs: Fix parameter name

svn path=/trunk/mcs/; revision=106731
2008-06-27 07:47:39 +00:00
Jb Evain 346ba0a7c9 2008-04-26 Jb Evain <[email protected]>
* CodeGenerator.cs: replace usage of new Type [0] by
	Type.EmptyTypes. Found with Gendarme.


svn path=/trunk/mcs/; revision=101928
2008-04-26 15:58:31 +00:00
Andreas N 2277a66937 2008-04-02 Andreas Nahr <[email protected]>
* BinaryFormatter.cs: Fix parameter names

svn path=/trunk/mcs/; revision=99614
2008-04-02 07:33:03 +00:00
Robert Jordan 3a9042c6e5 Resurrect r84839
svn path=/trunk/mcs/; revision=84841
2007-08-25 06:25:01 +00:00
Alan McGovern 4ab5568a5a reverted changes for datetime serialization
svn path=/trunk/mcs/; revision=84840
2007-08-25 02:32:55 +00:00
Robert Jordan 5ef01bea4b In System:
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-25 00:46:18 +00:00
Robert Jordan c76ea13748 In .:
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
2007-08-23 18:40:17 +00:00
Dick Porter ed0e0a5242 2007-05-03 Dick Porter <[email protected]>
* ProxyAttribute.cs: 
	* RealProxy.cs: Update to 2.0 profile

2007-05-03  Dick Porter  <[email protected]>

	* ITrackingHandler.cs: 
	* EnterpriseServicesHelper.cs: 
	* TrackingServices.cs: Update to 2.0 profile

2007-05-03  Dick Porter  <[email protected]>

	* IFieldInfo.cs: 
	* ISoapMessage.cs: 
	* InternalRM.cs: 
	* InternalST.cs: 
	* ServerFault.cs: 
	* SoapFault.cs: 
	* SoapMessage.cs: 
	* FormatterAssemblyStyle.cs: 
	* FormatterTypeStyle.cs: 
	* TypeFilterLevel.cs: Update to 2.0 profile

2007-05-03  Dick Porter  <[email protected]>

	* BinaryFormatter.cs: Update to 2.0 profile

2007-05-03  Dick Porter  <[email protected]>

	* Encoding.cs: 
	* UnicodeEncoding.cs: 
	* UTF7Encoding.cs: Update to 2.0 profile



svn path=/trunk/mcs/; revision=76625
2007-05-03 16:21:18 +00:00
Robert Jordan bb653a80a8 In System.Runtime.Remoting.Messaging:
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
2007-01-08 23:55:18 +00:00
Robert Jordan 7e0fe07971 Change eol-style to native.
svn path=/trunk/mcs/; revision=70681
2007-01-08 23:30:26 +00:00
Robert Jordan 39fbea3fba Normalize the line endings to CRLF.
svn path=/trunk/mcs/; revision=70679
2007-01-08 23:28:04 +00:00
Lluis Sanchez 7480608ca5 * MessageFormatter.cs: Include the logical context in the message when
throwing an exception. Fixes a compatibility issue with MS.NET.

svn path=/trunk/mcs/; revision=68828
2006-12-01 13:31:21 +00:00
Robert Jordan 83c1b15790 2006-10-29 Robert Jordan <[email protected]>
* ObjectWriter.cs, ObjectReader [NET_2_0]:
	Use the SerializationObjectManager.


svn path=/trunk/mcs/; revision=67110
2006-10-29 20:37:35 +00:00
Raja R Harinath f0af503273 In System.Runtime.Serialization.Formatters.Binary:
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
2006-09-05 12:10:14 +00:00
Raja R Harinath 045919d65c Make line-endings uniform. Pick the one which changes the least number of lines. Set eol-style=native on files with LF-endings.
svn path=/trunk/mcs/; revision=64923
2006-09-05 11:24:50 +00:00
Sebastien Pouliot 4281ad9b50 2005-12-07 Sebastien Pouliot <[email protected]>
* 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
2005-12-07 16:29:19 +00:00
Lluis Sanchez 11ebc5207d 2005-12-07 Lluis Sanchez Gual <[email protected]>
* ObjectReader.cs: Added null check in GetDeserializationType.
	Patch by Ben Maurer. Fixes bug #69666.


svn path=/trunk/mcs/; revision=54030
2005-12-07 12:47:08 +00:00
Sebastien Pouliot fcdf35c525 2005-12-01 Sebastien Pouliot <[email protected]>
* BinaryFormatter.cs: Added a demand for SerializationFormatter on 
	Serialize method (to make some CAS test work correctly).


svn path=/trunk/mcs/; revision=53770
2005-12-01 15:49:52 +00:00
Ben Maurer b27c8e1534 remove .cvsignore from everywhere, as it is useless on svn
svn path=/trunk/mcs/; revision=46564
2005-06-27 15:55:58 +00:00
Ben Maurer a68aa2eda4 remove executable bit from changelogs
svn path=/trunk/mcs/; revision=46563
2005-06-27 15:53:16 +00:00
Ben Maurer a0b608b4b6 2005-05-26 Ben Maurer <[email protected]>
* CodeGenerator.cs: Move module creation to cctor to kill double
	checked locking and typeof locking.


svn path=/trunk/mcs/; revision=45076
2005-05-26 20:19:52 +00:00
Lluis Sanchez 5cf54a0a21 2005-05-17 Lluis Sanchez Gual <[email protected]>
* CodeGenerator.cs: Don't generate debug info here.


svn path=/trunk/mcs/; revision=44619
2005-05-17 10:13:19 +00:00
Raja R Harinath e0cfa4925e Set svn:eol-style=native, delete svn:executable.
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
2005-05-16 12:23:26 +00:00
Lluis Sanchez 5d88607727 2005-05-09 Lluis Sanchez Gual <[email protected]>
* 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
2005-05-09 11:06:06 +00:00
Lluis Sanchez 159038b6fa 2005-03-23 Lluis Sanchez Gual <[email protected]>
* 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
2005-03-23 19:11:05 +00:00
Lluis Sanchez 7838d80521 2005-03-01 Lluis Sanchez Gual <[email protected]>
* 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
2005-03-03 17:05:26 +00:00