Bug 7957 - System.Xml.XmlException : 'Text' is an invalid node type
Summary: System.Xml.XmlException : 'Text' is an invalid node type
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: WCF assemblies ()
Version: unspecified
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-10-23 18:52 UTC by Ray
Modified: 2012-10-31 16:32 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Test case (1.32 MB, application/zip)
2012-10-23 18:52 UTC, Ray
Details
test.cs (2.58 KB, application/octet-stream)
2012-10-23 19:42 UTC, Rolf Bjarne Kvinge [MSFT]
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Ray 2012-10-23 18:52:48 UTC
Created attachment 2783 [details]
Test case

We're getting an exception thrown in XMLReader.cs. There's a test case attached that works on our other platforms, but fails when run in Monotouch/iOS.
Comment 1 Ray 2012-10-23 18:56:05 UTC
*The other platforms it runs on without throwing exceptions is both Windows 7, Windows Phone 7, and Windows 8.
Comment 2 Ray 2012-10-23 18:59:02 UTC
Edit: We run this code using .NET on the WP7/Windows8/WinRT platforms without exception.
Comment 3 Ray 2012-10-23 19:03:59 UTC
Capture of the stack trace at the time of the exception:

WorksOnOtherPlatforms : System.Xml.XmlException : 'Text' is an invalid node type.  Line 1, position 225.
XMLParseError[1610:1407] 		  at System.Xml.XmlReader.ReadStartElement () [0x00027] in /Developer/MonoTouch/Source/mono/mcs/class/System.XML/System.Xml/XmlReader.cs:721 
 XMLParseError[1610:1407] 		  at System.Xml.XmlDictionaryReader.ReadElementContentAsString () [0x00018] in /Developer/MonoTouch/Source/mono/mcs/class/System.Runtime.Serialization/System.Xml/XmlDictionaryReader.cs:397 
XMLParseError[1610:1407] 		  at System.Runtime.Serialization.XmlFormatterDeserializer.DeserializePrimitive (System.Type type, System.Xml.XmlReader reader, System.Xml.XmlQualifiedName qname) [0x00106] in /Developer/MonoTouch/Source/mono/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlFormatterDeserializer.cs:235 
XMLParseError[1610:1407] 		  at System.Runtime.Serialization.XmlFormatterDeserializer.Deserialize (System.Type type, System.Xml.XmlReader reader) [0x0028e] in /Developer/MonoTouch/Source/mono/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlFormatterDeserializer.cs:189 
XMLParseError[1610:1407] 		  at System.Runtime.Serialization.DictionaryTypeMap.DeserializeContent (System.Xml.XmlReader reader, System.Runtime.Serialization.XmlFormatterDeserializer deserializer, System.String id) [0x00062] in /Developer/MonoTouch/Source/mono/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/SerializationMap.cs:871 
2012-10-23 17:45:14.168 XMLParseError[1610:1407] 		  at System.Runtime.Serialization.DictionaryTypeMap.DeserializeEmptyContent (System.Xml.XmlReader reader, System.Runtime.Serialization.XmlFormatterDeserializer deserializer, System.String id) [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/SerializationMap.cs:857 
2012-10-23 17:45:14.169 XMLParseError[1610:1407] 		  at System.Runtime.Serialization.SerializationMap.DeserializeObject (System.Xml.XmlReader reader, System.Runtime.Serialization.XmlFormatterDeserializer deserializer) [0x0002b] in /Developer/MonoTouch/Source/mono/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/SerializationMap.cs:262 
XMLParseError[1610:1407] 		  at System.Runtime.Serialization.XmlFormatterDeserializer.DeserializeByMap (System.Xml.XmlQualifiedName name, System.Type type, System.Xml.XmlReader reader) [0x000d3] in /Developer/MonoTouch/Source/mono/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlFormatterDeserializer.cs:257 
XMLParseError[1610:1407] 		  at System.Runtime.Serialization.XmlFormatterDeserializer.Deserialize (System.Type type, System.Xml.XmlReader reader) [0x002e3] in /Developer/MonoTouch/Source/mono/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlFormatterDeserializer.cs:199 
XMLParseError[1610:1407] 		  at System.Runtime.Serialization.SerializationMap.DeserializeContent (System.Xml.XmlReader reader, System.Runtime.Serialization.XmlFormatterDeserializer deserializer, System.String id, Boolean empty) [0x00217] in /Developer/MonoTouch/Source/mono/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/SerializationMap.cs:347 
XMLParseError[1610:1407] 		  at System.Runtime.Serialization.SerializationMap.DeserializeContent (System.Xml.XmlReader reader, System.Runtime.Serialization.XmlFormatterDeserializer deserializer, System.String id) [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/SerializationMap.cs:292 
XMLParseError[1610:1407] 		  at System.Runtime.Serialization.SerializationMap.DeserializeObject (System.Xml.XmlReader reader, System.Runtime.Serialization.XmlFormatterDeserializer deserializer) [0x0003a] in /Developer/MonoTouch/Source/mono/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/SerializationMap.cs:264 
XMLParseError[1610:1407] 		  at System.Runtime.Serialization.XmlFormatterDeserializer.DeserializeByMap (System.Xml.XmlQualifiedName name, System.Type type, System.Xml.XmlReader reader) [0x000d3] in /Developer/MonoTouch/Source/mono/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlFormatterDeserializer.cs:257 
XMLParseError[1610:1407] 		  at System.Runtime.Serialization.XmlFormatterDeserializer.Deserialize (System.Type type, System.Xml.XmlReader reader) [0x002e3] in /Developer/MonoTouch/Source/mono/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlFormatterDeserializer.cs:199 
XMLParseError[1610:1407] 		  at System.Runtime.Serialization.XmlFormatterDeserializer.Deserialize (System.Xml.XmlReader reader, System.Type declaredType, System.Runtime.Serialization.KnownTypeCollection knownTypes, IDataContractSurrogate surrogate, System.Runtime.Serialization.DataContractResolver resolver, System.Runtime.Serialization.DataContractResolver defaultResolver, System.String name, System.String ns, Boolean verifyObjectName) [0x0007e] in /Developer/MonoTouch/Source/mono/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlFormatterDeserializer.cs:65 
XMLParseError[1610:1407] 		  at System.Runtime.Serialization.DataContractSerializer.ReadObject (System.Xml.XmlDictionaryReader reader, Boolean verifyObjectName) [0x00024] in /Developer/MonoTouch/Source/mono/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/DataContractSerializer.cs:350 
XMLParseError[1610:1407] 		  at System.Runtime.Serialization.XmlObjectSerializer.ReadObject (System.Xml.XmlDictionaryReader reader) [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlObjectSerializer.cs:74 
XMLParseError[1610:1407] 		  at System.Runtime.Serialization.DataContractSerializer.ReadObject (System.Xml.XmlReader reader) [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/DataContractSerializer.cs:335 
XMLParseError[1610:1407] 		  at System.Runtime.Serialization.XmlObjectSerializer.ReadObject (System.IO.Stream stream) [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlObjectSerializer.cs:64 
XMLParseError[1610:1407] 		  at XMLParseError.Example.WorksOnOtherPlatforms () [0x00025] in /Users/raybatts/Projects/XMLParseError/XMLParseError/Example.cs:61 
XMLParseError[1610:1407] 		  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
XMLParseError[1610:1407] 		  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x000c0] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:234
Comment 4 Rolf Bjarne Kvinge [MSFT] 2012-10-23 19:42:47 UTC
Created attachment 2784 [details]
test.cs

This is not limited to MonoTouch, it also happens on desktop (with Mono).

Repro:
Compile (mcs -r:System.Runtime.Serialization.dll test.cs) and run attached sample.
Comment 5 Rolf Bjarne Kvinge [MSFT] 2012-10-23 19:45:04 UTC
Thanks for a perfect test case btw.
Comment 6 Atsushi Eno 2012-10-23 23:19:36 UTC
Fixed (master 62bf3c73c, 2.10/mm as well).
Comment 7 Ray 2012-10-24 15:39:43 UTC
Thanks a lot for a speedy solution.

Until the next release, is there a temporary workaround? Or a way I can build MonoTouch against the version of Mono located in Github?