c# - XML serialization and MS/Mono portability -


I am trying to sort classes using MS runtime and mono runtime. Everything is fine when using MS runtime, but using mono gives me some exceptions and programmers startup.

The following exceptions have been thrown:

  • One type: System.TypeInitializationException (one class)
  • There was an error in reflecting a type Was: System. Unexpected Operation Exception (one class)
  • There was an error showing a field: System.ArgumentOutOfRangeException & lt; 0 (an array of classes)

The binary was compiled using MS SDK, but I do not think this is a problem.

What's going on? Can not .net portable? How to solve these exceptions?


I have installed Installer Mono for Windows (only for sake) Install Monodevelop and get the same problems. Here is a class that causes problems: [XmlInclude (Typef (XMLS)] [XmlInclude (Typef (XMLUsorlogin))] [XmlInclude (Typef (XML Service))] [ XmlInclude (typeof (XmlUserList)] [XmlInclude (typeof (XmlGroupList)] Public class XmlMessage {... [XmlAttribute] Public XmlMessageCode Code = XmlMessageCode.Invalid; [XmlAttribute] Public XmlMessageError Error = XmlMessageError.None; Public goods = null; Private Static XmlSerializer mXmlSerialize = New XmlSerializer (Type (XmlMessage)); }

The exception text is exclusively:

  Unchecked exception: System.TypeInitializationException: An exception was thrown by the initializer for IGecko.XmlClientConfiguration - - & gt; System.TypeInitializationException: One exception was thrown by type initializer for iGecko.Net.XmlMessageClient ---; System.InvalidOperationException: There was an error indicating 'iGecko.Net.XmlMessage' type --- & gt; System.InvalidOperationException: There was an error indicating 'iGecko.Net.XmlProcessList' type --- & gt; System.InvalidOperationException: There was an error indicating the field 'item' --- & gt; System.ArgumentOutOfRangeException: The name of the parameter can not be negative: Length  

I forgot to say that it occurs during the constructor, which should be serialized above the square. Sorry for editing 'gorgeous', but I'm starting to understand the error XmlMessage has an object public field , Which can be assigned an XmlProcessList class, which is derived from the class described in this post (), which defines the item field. Try running your application via

Comments