[Mono-dev] Exception in XmlSerializer (only with arm cross-compile , x86 no issue)

Ran Shalit ranshalit at gmail.com
Fri Sep 23 21:08:39 UTC 2016


On Fri, Sep 23, 2016 at 10:56 PM, Ran Shalit <ranshalit at gmail.com> wrote:
> On Fri, Sep 23, 2016 at 2:29 PM, Ran Shalit <ranshalit at gmail.com> wrote:
>> On Fri, Sep 23, 2016 at 7:48 AM, Ran Shalit <ranshalit at gmail.com> wrote:
>>> Hello,
>>>
>>> I managed to cross build and run successfuly simple application arm
>>> (using 3.8.0 mono version without any modifications).
>>> On running a simple hello world it works fine. But then running the
>>> required application throws the following error.
>>> I should also note that I copied the class library from host in order
>>> for it to works becuase the deplyment (make install) is missing all
>>> these dlls.
>>> I also see that the same source version 3.8.0 on my PC , I manage to
>>> run the application without this exception (in PC x86), so I suspect
>>> that it is related to the fact that the same source code is cross
>>> build to arm (armv5) maybe.
>>>
>>>
>>> This is the log when running the application:
>>>
>>> # mono /home/modem/Elbit/Elbit_test/Elbit.Jdss.TestConsoleMonoNoUI.exe
>>> Elbit.Jdss.TestConsoleMonoNoUI
>>>
>>> My IP is 192.168.7.2
>>> Running on Unix
>>> Running with the Mono VM
>>> .NET Framework Assemblies Path:
>>> file:///home/modem/local/lib/mono/4.5/mscorlib.dll
>>>
>>> Unhandled Exception:
>>> [0xbeb0be6c]
>>>
>>> [ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException:
>>> An exception was thrown by the type initializer for
>>> System.Xml.Serialization.XmlSerializer --->
>>> System.Configuration.ConfigurationErrorsException: Error Initializing
>>> the configuration system. --->
>>> System.Configuration.ConfigurationErrorsException: Unrecognized
>>> configuration section <startup>
>>> (/home/modem/Elbit/Elbit_test/Elbit.Jdss.TestConsoleMonoNoUI.exe.config
>>> line 3)
>>>   at System.Configuration.ConfigInfo.ThrowException (System.String
>>> text, System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0
>>>   at System.Configuration.SectionGroupInfo.ReadContent
>>> (System.Xml.XmlReader reader, System.Configuration.Configuration
>>> config, Boolean overrideAllowed, Boolean root) [0x00000] in <filename
>>> unknown>:0
>>>   at System.Configuration.SectionGroupInfo.ReadRootData
>>> (System.Xml.XmlReader reader, System.Configuration.Configuration
>>> config, Boolean overrideAllowed) [0x00000] in <filename unknown>:0
>>>   at System.Configuration.Configuration.ReadConfigFile
>>> (System.Xml.XmlReader reader, System.String fileName) [0x00000] in
>>> <filename unknown>:0
>>>   at System.Configuration.Configuration.Load () [0x00000] in <filename
>>> unknown>:0
>>>   at System.Configuration.Configuration.Init (IConfigSystem system,
>>> System.String configPath, System.Configuration.Configuration parent)
>>> [0x00000] in <filename unknown>:0
>>>   at System.Configuration.Configuration..ctor
>>> (System.Configuration.InternalConfigurationSystem system,
>>> System.String locationSubPath) [0x00000] in <filename unknown>:0
>>>   at System.Configuration.InternalConfigurationFactory.Create
>>> (System.Type typeConfigHost, System.Object[]
>>> hostInitConfigurationParams) [0x00000] in <filename unknown>:0
>>>
>>> I see that there is bug report about XmlSerializer, but this same
>>> version works in PC (x86) without issues, so I am not sure what it
>>> means.
>>>
>>> Best Regards,
>>> Ran
>>
>>
>> I would like to add more information:
>>
>> On trying to understand the exception in TypeInitializationException,
>> I upgraded from 3.10.0 to 3.12.1, but still get this exception - only
>> in the arm target -
>> With PC x86, the application works without any issue (with this same
>> version 3.12.1).
>>
>> Regards,
>> Ran
>
>
> Hi,
>
> I have found somiliar description of exception in:
> http://lists.ximian.com/pipermail/monodevelop-list/2010-September/012646.html
> With the solution:
> "
> But I have solved the problem: It was caused by that I moved the /usr dir to
> another harddrive and symlinked it to the rot directory. By mount the /usr
> dir instead fixed it.
> "
> In my case we also link the usr to another driver, can this actually
> resolve the issue ? Why does it matters if it is link or not ?
>
> Thank you,
> Ran

I've found the issue:

I had copied the assemblies from pc, from /usr/lib/mono , but I lso
had to copy /usr/local/etc/mono folders.
I wish "make install" had made it all , and sould not require
additional build and copying. It would have made life more easier.
Even at this point, I still not sure about the exact required steps of
copying the "mono" assemblies and /etc folders. I wish it was
documented somewhere for other who try to build mono and deploy to
some target.

Thank you,
Ran


More information about the Mono-devel-list mailing list