It was set by xamarin-macios when they were still taking the raw .cs source files
but since we switched to prebuilt binaries we need to replace it with
some define we're actually setting in Mono.
Most cases can be replaced by just XAMMAC_4_5 since MOBILE is defined on the xammac profile.
Most of them used multiline C# string literals which
means they contained the line ending character of the file.
Updated to make the tests resilient to having CRLF instead of LF.
Some of the mcs tests used a checksum to compare files,
ensured those are checked out using LF.
nunitlite does not contain Assertion class.
nunitlite does not implement Is.InstanceOfType, replaced usages of:
Assert.That (type, Is.InstanceOfType(typeof(T))) with Assert.IsInstanceOfType.
Per current .NET, exception serialization may be implemented using the
SerializeObjectState event. Use of this approach is mandatory for
certain classes, such as HttpRequestException subclasses. Mono does
not support it. The solution is to switch out our System.Exception
implementation for the referencesource one.
To accommodate this, classes that access System.Exception internal
fields directly must switch to the new field names; a new support
method is added to System.Environment; the "security level" methods
and icall are added to MonoCMethods; and the field order in
_MonoException must be adjusted. A new test is also added in the
System.Runtime.Serialization assembly.
The shim/bridge between Mono and the RS implementation of
XmlObjectSerializer, DataContractSerializer, etc. did not properly
invoke the constructor required by ISerializable, as it completely
omitted passing the populated SerializationInfo object.
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=37171
With C6 we introduced a regression
https://bugzilla.xamarin.com/show_bug.cgi?id=36100, which is caused by
the new static serialization code that we wrote to reuse Microsoft's
serializer.
The code uses Invoke on a series of MethodInfos, and this obscures the
actual code that will be invoked at runtime to serialize certain
objects, causing the following exception:
Attempting to JIT compile method '(wrapper runtime-invoke) <Module>:runtime_invoke_bool_Nullable`1<Decimal> (object,intptr,intptr,intptr)' while running with --aot-only.
This patch makes the simple code work, but a more thorough review of
the code would allow us to remove many of the slow dynamic codepaths
in the serializer.
We opted for that approach to keep the code as similar as possible to the
original.
But the code basically does this:
* Use the XmlFormatGeneratorStatics property InternalSerializeMethod,
whose sole purpose is to delay computing the MethodInfo for the
XmlFormatWriterGenerator's InternalSerialize.
* Use the resulting method in a few places to call the MethodInfo.
The MethodInfo was used because the original code uses Reflection.Emit
to create fast serializers and it needs handles to internal methods,
but our static rewriter does not need it.
We should replace all of those uses, but for now, this patch at least
deals with the 36100 bug.
NET_4_0 is always defined now, so the ifdefs are redundant.
I verified the libs are exactly the same after this change, so this is effectively a no-op.
WriteStartDocument() can be used with document and document does not accept
more than one element, which basically contradicts MTOM writer usage.
For EOL changes, MTOM writer should not alter content EOL chars.
MTOM writer didn't expect multiple top-level elements are rejected at
ConformanceLevel.Auto, neiher do against Write[Start/End]Document() with
such elements.
Also Flush is often needed before directly writing to the Stream(Writer).
EOLs handling was also inconsistent between referencesource and old mono.
* System.Runtime.Serialization/XsdDataContractImporter:
Check ImportOptions.ReferencedCollectionTypes to determine the proxy type.
* System.ServiceModel.Description/MetadataImporter.cs:
Very simply implementation of the 'State' property.
* System.ServiceModel.Description/DataContractSerializerMessageContractImporter.cs:
Use it here.
* Test/Resources/WSDL: Added some sample .wsdl files for the new tests; adding
these as resources to the test dll.
* Test/System.Runtime.Serialization: Added WsdlHelper.cs,
XsdDataContractImporterTest2.cs and XsdDataContractExportTest2.cs
* Implement "Interchangeable Collections" and Collection Interface Types.
(see http://msdn.microsoft.com/en-us/library/aa347850.aspx)
* Add element type check for arrays.
* Identify custom collection types (must have a public parameterless
constructor and an "Add" method with the correct argument type) and
distinguish them from types which implement one or more of the
collection interfaces without being a custom collection type.
* Add some checks for [CollectionDataContract].
* Added some NUnit tests for that.
- Fix bug 4794 by searching the SerializationMap with both type and
qname in all but several cases (see bug report comments)
- Add separate list for known types to mimic behavior of the .NET
runtime
- Make previous test fixtures public so that the unit tests will be run
- Remove unused private method
- Add unit test for bug 4794