0

使用 Mono读取此有效 XMLSystem.Xml.XmlReader时,出现以下错误:

System.InvalidOperationException: Read by order only possible for encoded/bare format
  at System.Xml.Serialization.ClassMap.GetElement (Int32 index) [0x00000] in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadMembers (System.Xml.Serialization.ClassMap map, System.Object ob, Boolean isValueList, Boolean readBySoapOrder) [0x00000] in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadClassInstanceMembers (System.Xml.Serialization.XmlTypeMapping typeMap, System.Object ob) [0x00000] in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadClassInstance (System.Xml.Serialization.XmlTypeMapping typeMap, Boolean isNullable, Boolean checkType) [0x00000] in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadObject (System.Xml.Serialization.XmlTypeMapping typeMap, Boolean isNullable, Boolean checkType) [0x00000] in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadObjectElement (System.Xml.Serialization.XmlTypeMapElementInfo elem) [0x00000] in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadMembers (System.Xml.Serialization.ClassMap map, System.Object ob, Boolean isValueList, Boolean readBySoapOrder) [0x00000] in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadClassInstanceMembers (System.Xml.Serialization.XmlTypeMapping typeMap, System.Object ob) [0x00000] in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadClassInstance (System.Xml.Serialization.XmlTypeMapping typeMap, Boolean isNullable, Boolean checkType) [0x00000] in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadObject (System.Xml.Serialization.XmlTypeMapping typeMap, Boolean isNullable, Boolean checkType) [0x00000] in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadRoot (System.Xml.Serialization.XmlTypeMapping rootMap) [0x00000] in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadRoot () [0x00000] in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.Serialization.XmlSerializationReader reader) [0x00000] in <filename unknown>:0 

问题是什么?

首先是什么Read by order only possible for encoded/bare format意思?

Monodevelop 2.8.6.3 on Ubuntu 2012.04 运行平台 Mono / .NET 3.5
Mono JIT 编译器 2.10.8.1

4

2 回答 2

2

单声道崩溃<xsd:choice>

请参阅https://bugzilla.xamarin.com/show_bug.cgi?id=2907

于 2012-08-17T10:40:58.093 回答
1

我已经发布了修复这个问题的补丁。它适用于主干版本(3.0.?)。如果你不想接触用户的单声道,你可以简单地将新的 System.Xml.dll 复制到你的程序所在的文件夹中。Mono 将使用您的 dll 而不是用户的。

该补丁附加到此错误:https ://bugzilla.xamarin.com/show_bug.cgi?id=2907

于 2012-11-01T09:28:43.197 回答