Bug 28682 - System.TypeLoadException "Could not load type System.Int64" on iOS or "Could not load type System.DateTime" on Android when trying to create System.XML.XmlSerializer
Summary: System.TypeLoadException "Could not load type System.Int64" on iOS or "Could ...
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.XML ()
Version: unspecified
Hardware: PC Mac OS
: Normal normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-04-02 08:47 UTC by dmitri.toropov
Modified: 2015-05-19 06:03 UTC (History)
4 users (show)

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

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 dmitri.toropov 2015-04-02 08:47:39 UTC
I' trying to execute the following piece of code:
public XmlSerializer GetSerializer(Type type)
{
    ...
    result = new XmlSerializer(type);
    ...
}

When running on iOS Simulator it works, it works on Android device in Debug mode, but it crashes on iOS device (always, independently whether in debug mode or not) and it crashes on Android device when build in Release mode.

Please pay attention, that on both Android and iOS the problem appears on the same class and property, but the type that cannot be loaded is different.

The code is inside a PCL, .Net 4.5 Profile 78. All latest updates to Xamarin Studio, Xamarin.iOS and Xamarin.Android installed. The code is a part of a Windows application that is well tested and is known to work.

Here is the iOS exception:
(
Exception: System.InvalidOperationException
HResult: -2146233079
Message: There was an error reflecting type 'DocuWare.Platform.ServerClient.DialogInfos'.
Source: System.Xml
StackTrace:
  at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace) [0x0014a] in ///Library/Frameworks/Xamarin.iOS.framework/Versions/8.8.0.2/src/mono/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:243 
  at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Type type, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace) [0x00047] in ///Library/Frameworks/Xamarin.iOS.framework/Versions/8.8.0.2/src/mono/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:196 
  at System.Xml.Serialization.XmlSerializer..ctor (System.Type type, System.Xml.Serialization.XmlAttributeOverrides overrides, System.Type[] extraTypes, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace) [0x0004d] in ///Library/Frameworks/Xamarin.iOS.framework/Versions/8.8.0.2/src/mono/mcs/class/System.XML/System.Xml.Serialization/XmlSerializer.cs:227 
  at System.Xml.Serialization.XmlSerializer..ctor (System.Type type) [0x00000] in ///Library/Frameworks/Xamarin.iOS.framework/Versions/8.8.0.2/src/mono/mcs/class/System.XML/System.Xml.Serialization/XmlSerializer.cs:175 
  at DocuWare.Services.Http.Client.XmlSerializerRepository.GetSerializer (System.Type type) [0x0003c] in /Users/dmitri.toropov/Development/Docuware/tfs/DocuWare .NET/Main/src/DocuWare/RestfulWebservices/RestClient/RestClient/XmlSerializerRepository.cs:39 
  at DocuWare.Services.Http.DeserializedHttpResponse+<ReadAsObject>c__AnonStorey3`1[DocuWare.Platform.ServerClient.DialogInfos].<>m__0 (System.Threading.Tasks.Task`1 stream) [0x00000] in <filename unknown>:0 
  at System.Threading.Tasks.TaskActionInvoker+FuncTaskInvoke`2[System.IO.Stream,DocuWare.Services.Http.DeserializedHttpResponse`1[DocuWare.Platform.ServerClient.DialogInfos]].Invoke (System.Threading.Tasks.Task owner, System.Object state, System.Threading.Tasks.Task context) [0x00000] in <filename unknown>:0 
  at System.Threading.Tasks.Task.InnerInvoke () [0x00019] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Threading.Tasks/Task.cs:546 
  at System.Threading.Tasks.Task.ThreadStart () [0x000d0] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Threading.Tasks/Task.cs:438 

InnerException:
(
Exception: System.InvalidOperationException
HResult: -2146233079
Message: There was an error reflecting field 'Dialog'.
Source: System.Xml
StackTrace:
  at System.Xml.Serialization.XmlReflectionImporter.ImportClassMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace, Boolean isBaseType) [0x0022a] in ///Library/Frameworks/Xamarin.iOS.framework/Versions/8.8.0.2/src/mono/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:385 
  at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace) [0x00074] in ///Library/Frameworks/Xamarin.iOS.framework/Versions/8.8.0.2/src/mono/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:221 

InnerException:
(
Exception: System.InvalidOperationException
HResult: -2146233079
Message: There was an error reflecting type 'DocuWare.Platform.ServerClient.DialogInfo'.
Source: System.Xml
StackTrace:
  at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace) [0x0014a] in ///Library/Frameworks/Xamarin.iOS.framework/Versions/8.8.0.2/src/mono/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:243 
  at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Type type, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace) [0x00047] in ///Library/Frameworks/Xamarin.iOS.framework/Versions/8.8.0.2/src/mono/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:196 
  at System.Xml.Serialization.XmlReflectionImporter.ImportElementInfo (System.Type cls, System.String defaultName, System.String defaultNamespace, System.Type defaultType, System.Xml.Serialization.XmlTypeMapMemberElement member, System.Xml.Serialization.XmlAttributes atts) [0x0034d] in ///Library/Frameworks/Xamarin.iOS.framework/Versions/8.8.0.2/src/mono/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:1003 
  at System.Xml.Serialization.XmlReflectionImporter.CreateMapMember (System.Type declaringType, System.Xml.Serialization.XmlReflectionMember rmember, System.String defaultNamespace) [0x00319] in ///Library/Frameworks/Xamarin.iOS.framework/Versions/8.8.0.2/src/mono/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:883 
  at System.Xml.Serialization.XmlReflectionImporter.ImportClassMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace, Boolean isBaseType) [0x00206] in ///Library/Frameworks/Xamarin.iOS.framework/Versions/8.8.0.2/src/mono/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:381 

InnerException:
(
Exception: System.InvalidOperationException
HResult: -2146233079
Message: There was an error reflecting type 'DocuWare.Platform.ServerClient.Dialog'.
Source: System.Xml
StackTrace:
  at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace) [0x0014a] in ///Library/Frameworks/Xamarin.iOS.framework/Versions/8.8.0.2/src/mono/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:243 
  at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Type type, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace) [0x00047] in ///Library/Frameworks/Xamarin.iOS.framework/Versions/8.8.0.2/src/mono/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:196 
  at System.Xml.Serialization.XmlReflectionImporter.ImportIncludedTypes (System.Type type, System.String defaultNamespace) [0x00027] in ///Library/Frameworks/Xamarin.iOS.framework/Versions/8.8.0.2/src/mono/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:693 
  at System.Xml.Serialization.XmlReflectionImporter.ImportClassMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace, Boolean isBaseType) [0x003ae] in ///Library/Frameworks/Xamarin.iOS.framework/Versions/8.8.0.2/src/mono/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:420 
  at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace) [0x00074] in ///Library/Frameworks/Xamarin.iOS.framework/Versions/8.8.0.2/src/mono/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:221 

InnerException:
(
Exception: System.InvalidOperationException
HResult: -2146233079
Message: There was an error reflecting field 'Fields'.
Source: System.Xml
StackTrace:
  at System.Xml.Serialization.XmlReflectionImporter.ImportClassMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace, Boolean isBaseType) [0x0022a] in ///Library/Frameworks/Xamarin.iOS.framework/Versions/8.8.0.2/src/mono/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:385 
  at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace) [0x00074] in ///Library/Frameworks/Xamarin.iOS.framework/Versions/8.8.0.2/src/mono/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:221

InnerException:
(
Exception: System.InvalidOperationException
HResult: -2146233079
Message: There was an error reflecting type 'DocuWare.Platform.ServerClient.DialogField'.
Source: System.Xml						(						)						StackTrace:
  at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace) [0x0014a] in ///Library/Frameworks/Xamarin.iOS.framework/Versions/8.8.0.2/src/mono/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:243 
  at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Type type, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace) [0x00047] in ///Library/Frameworks/Xamarin.iOS.framework/Versions/8.8.0.2/src/mono/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:196 
  at System.Xml.Serialization.XmlReflectionImporter.ImportListMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace, System.Xml.Serialization.XmlAttributes atts, Int32 nestingLevel) [0x001c6] in ///Library/Frameworks/Xamarin.iOS.framework/Versions/8.8.0.2/src/mono/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:525 
  at System.Xml.Serialization.XmlReflectionImporter.ImportListMapping (System.Type type, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace, System.Xml.Serialization.XmlAttributes atts, Int32 nestingLevel) [0x00007] in ///Library/Frameworks/Xamarin.iOS.framework/Versions/8.8.0.2/src/mono/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:488 
  at System.Xml.Serialization.XmlReflectionImporter.CreateMapMember (System.Type declaringType, System.Xml.Serialization.XmlReflectionMember rmember, System.String defaultNamespace) [0x00401] in ///Library/Frameworks/Xamarin.iOS.framework/Versions/8.8.0.2/src/mono/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:900 
  at System.Xml.Serialization.XmlReflectionImporter.ImportClassMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace, Boolean isBaseType) [0x00206] in ///Library/Frameworks/Xamarin.iOS.framework/Versions/8.8.0.2/src/mono/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:381 

InnerException:
(
Exception: System.InvalidOperationException
HResult: -2146233079
Message: There was an error reflecting field 'PrefillValue'.
Source: System.Xml
StackTrace:
  at System.Xml.Serialization.XmlReflectionImporter.ImportClassMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace, Boolean isBaseType) [0x0022a] in ///Library/Frameworks/Xamarin.iOS.framework/Versions/8.8.0.2/src/mono/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:385 
  at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace) [0x00074] in ///Library/Frameworks/Xamarin.iOS.framework/Versions/8.8.0.2/src/mono/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:221 

InnerException:
(
Exception: System.TypeLoadException
HResult: -2146233054
Message: Could not load type System.Int64, System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a while decoding custom attribute
Source: mscorlib
StackTrace:
  at (wrapper managed-to-native) System.MonoCustomAttrs:GetCustomAttributesInternal (System.Reflection.ICustomAttributeProvider,System.Type,bool)
  at System.MonoCustomAttrs.GetCustomAttributesBase (ICustomAttributeProvider obj, System.Type attributeType, Boolean inheritedOnly) [0x00019] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System/MonoCustomAttrs.cs:103 
  at System.MonoCustomAttrs.GetCustomAttributes (ICustomAttributeProvider obj, Boolean inherit) [0x00017] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System/MonoCustomAttrs.cs:284 
  at System.Reflection.MonoProperty.GetCustomAttributes (Boolean inherit) [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Reflection/MonoProperty.cs:233 
  at System.Xml.Serialization.XmlAttributes..ctor (ICustomAttributeProvider provider) [0x00032] in ///Library/Frameworks/Xamarin.iOS.framework/Versions/8.8.0.2/src/mono/mcs/class/System.XML/System.Xml.Serialization/XmlAttributes.cs:64 
  at System.Xml.Serialization.XmlReflectionImporter.GetReflectionMembers (System.Type type) [0x00242] in ///Library/Frameworks/Xamarin.iOS.framework/Versions/8.8.0.2/src/mono/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:774 
  at System.Xml.Serialization.XmlReflectionImporter.ImportClassMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace, Boolean isBaseType) [0x00081] in ///Library/Frameworks/Xamarin.iOS.framework/Versions/8.8.0.2/src/mono/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:354 
  at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace) [0x00074] in ///Library/Frameworks/Xamarin.iOS.framework/Versions/8.8.0.2/src/mono/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:221 
  at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Type type, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace) [0x00047] in ///Library/Frameworks/Xamarin.iOS.framework/Versions/8.8.0.2/src/mono/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:196 
  at System.Xml.Serialization.XmlReflectionImporter.ImportElementInfo (System.Type cls, System.String defaultName, System.String defaultNamespace, System.Type defaultType, System.Xml.Serialization.XmlTypeMapMemberElement member, System.Xml.Serialization.XmlAttributes atts) [0x0034d] in ///Library/Frameworks/Xamarin.iOS.framework/Versions/8.8.0.2/src/mono/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:1003 
  at System.Xml.Serialization.XmlReflectionImporter.CreateMapMember (System.Type declaringType, System.Xml.Serialization.XmlReflectionMember rmember, System.String defaultNamespace) [0x00319] in ///Library/Frameworks/Xamarin.iOS.framework/Versions/8.8.0.2/src/mono/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:883 
  at System.Xml.Serialization.XmlReflectionImporter.ImportClassMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace, Boolean isBaseType) [0x00206] in ///Library/Frameworks/Xamarin.iOS.framework/Versions/8.8.0.2/src/mono/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:381 
))))))))

And the Android exception is as follows:
[mono]
[mono] Unhandled Exception:
[mono] System.InvalidOperationException: There was an error reflecting type 'DocuWare.Platform.ServerClient.DialogInfos'. ---> System.InvalidOperationException: There was an error reflecting field 'Dialog'. ---> System.InvalidOperationException: There was an error reflecting type 'DocuWare.Platform.ServerClient.DialogInfo'. ---> System.InvalidOperationException: There was an error reflecting type 'DocuWare.Platform.ServerClient.Dialog'. ---> System.InvalidOperationException: There was an error reflecting field 'Fields'. ---> System.InvalidOperationException: There was an error reflecting type 'DocuWare.Platform.ServerClient.DialogField'. ---> System.InvalidOperationException: There was an error reflecting field 'PrefillValue'. ---> System.TypeLoadException: Could not load type System.DateTime, System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a while decoding custom attribute
[mono]   at (wrapper managed-to-native) System.MonoCustomAttrs:GetCustomAttributesInternal (System.Reflection.ICustomAttributeProvider,System.Type,bool)
[mono]   at System.MonoCustomAttrs.GetCustomAttributesBase (ICustomAttributeProvider obj, System.Type attributeType, Boolean inheritedOnly) [0x00000] in <filename unknown>:0
[mono]   at System.MonoCustomAttrs.GetCustomAttributes (ICustomAttributeProvider obj, Boolean inherit) [0x00000] in <filename unknown>:0
[mono]   at System.Reflection.MonoProperty.GetCustomAttributes (Boolean inherit) [0x00000] in <filename unknown>:0
[mono]   at System.Xml.Serialization.XmlAttributes..ctor (ICustomAttributeProvider provider) [0x00000] in <filename unknown>:0
[mono]   at System.Xml.Serialization.XmlReflectionImporter.GetReflectionMembers (System.Type type) [0x00000] in <filename unknown>:0
[mono]   at System.Xml.Serialization.XmlReflectionImporter.ImportClassMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace, Boolean isBaseType) [0x00000] in <filename unknown>:0
[mono]   at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace) [0x00000] in <filename unknown>:0
[mono]   at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Type type, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace) [0x00000] in <filename unknown>:0
[mono]   at System.Xml.Serialization.XmlReflectionImporter.ImportElementInfo (System.Type cls, System.String defaultName, System.String defaultNamespace, System.Type defaultType, System.Xml.Serialization.XmlTypeMapMemberElement member, System.Xml.Serialization.XmlAttributes atts) [0x00000] in <filename unknown>:0
[mono]   at System.Xml.Serialization.XmlReflectionImporter.CreateMapMember (System.Type declaringType, System.Xml.Serialization.XmlReflectionMember rmember, System.String defaultNamespace) [0x00000] in <filename unknown>:0
[mono]   at System.Xml.Serialization.XmlReflectionImporter.ImportClassMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace, Boolean isBaseType) [0x00000] in <filename unknown>:0
[mono]   --- End of inner exception stack trace ---
[mono]   at System.Xml.Serialization.XmlReflectionImporter.ImportClassMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace, Boolean isBaseType) [0x00000] in <filename unknown>:0
[mono]   at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace) [0x00000] in <filename unknown>:0
[mono]   --- End of inner exception stack trace ---
[mono]   at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace) [0x00000] in <filename unknown>:0
[mono]   at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping
 

The definition of the PrefillValue property is like this:
        [System.Xml.Serialization.XmlElementAttribute("PrefillValue")]
        public List<DocumentIndexFieldValue> PrefillValue {
            get {
                return this.prefillValueField;
            }
            set {
                this.prefillValueField = value;
            }
        }
The definition of the DocumentIndexFieldValue class is as follows:
    public partial class DocumentIndexFieldValue : DocumentIndexFieldValueBase {
    }

    public abstract partial class DocumentIndexFieldValueBase {        
        [System.Xml.Serialization.XmlElementAttribute("Date", typeof(System.DateTime), DataType="date")]
        [System.Xml.Serialization.XmlElementAttribute("DateTime", typeof(System.DateTime))]
        [System.Xml.Serialization.XmlElementAttribute("Decimal", typeof(decimal))]
        [System.Xml.Serialization.XmlElementAttribute("Int", typeof(long))]
        [System.Xml.Serialization.XmlElementAttribute("Keywords", typeof(DocumentIndexFieldKeywords))]
        [System.Xml.Serialization.XmlElementAttribute("Memo", typeof(string))]
        [System.Xml.Serialization.XmlElementAttribute("String", typeof(string))]
        ...
    }

On Android it crashes at the first property, on iOS it works for the first 3 properties but crashes on "Int".
Comment 1 dmitri.toropov 2015-04-07 08:57:53 UTC
More complete description of the DocumentIndexFieldValueBase to make clear what is meant:

    [System.Xml.Serialization.XmlIncludeAttribute(typeof(SuggestionValue))]
    [System.Xml.Serialization.XmlIncludeAttribute(typeof(DocumentIndexField))]
    [System.Xml.Serialization.XmlIncludeAttribute(typeof(DocumentIndexFieldValue))]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("XMLSchemaImporter", "0.6.0.0")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
        public abstract partial class DocumentIndexFieldValueBase {
        
        private object itemField;
        
        private ItemChoiceType itemElementNameField;
        
        [System.Xml.Serialization.XmlElementAttribute("Date", typeof(System.DateTime), DataType="date")]
        [System.Xml.Serialization.XmlElementAttribute("DateTime", typeof(System.DateTime))]
        [System.Xml.Serialization.XmlElementAttribute("Decimal", typeof(decimal))]
        [System.Xml.Serialization.XmlElementAttribute("Int", typeof(long))]
        [System.Xml.Serialization.XmlElementAttribute("Keywords", typeof(DocumentIndexFieldKeywords))]
        [System.Xml.Serialization.XmlElementAttribute("Memo", typeof(string))]
        [System.Xml.Serialization.XmlElementAttribute("String", typeof(string))]
        [System.Xml.Serialization.XmlChoiceIdentifierAttribute("ItemElementName")]
        public object Item {
            get {
                return this.itemField;
            }
            set {
                if(value != null && value.GetType() == typeof(int))
                   this.itemField = (long)(int)value;
                else
                   this.itemField = value;
            }
        }
...
}
Comment 4 Miguel de Icaza [MSFT] 2015-05-08 13:56:39 UTC
I can not reproduce this with the latest version of the product on iOS/Device.
Comment 5 Miguel de Icaza [MSFT] 2015-05-18 15:59:41 UTC
Feel free to reopen the bug if you can find a way to make it reproduce with a current version.
Comment 6 dmitri.toropov 2015-05-19 06:03:13 UTC
The bug is disappeared with Mono 4.0.0, it can be closed.