Exception using Noesis and .Net Compability level 2.0 on IOS
Hi, when running my unity application on IOS, with .NET 2.0 as Api compatibility level I get the following exception:
ExecutionEngineException: Attempting to call method 'System.Reflection.MonoProperty::GetterAdapterFrame' for which no ahead of time (AOT) code was generated.
at Noesis.Extend.GetPropertyValue_String (IntPtr unityType, Int32 propertyIndex, IntPtr cPtr) [0x00000] in <filename unknown>:0
at Noesis.UIRenderer.Noesis_CreateRenderer (IntPtr root) [0x00000] in <filename unknown>:0
at Noesis.UIRenderer..ctor (Noesis.FrameworkElement content, Vector2 offscreenSize, UnityEngine.GameObject target) [0x00000] in <filename unknown>:0
at NoesisGUIPanel.LoadXaml () [0x00000] in <filename unknown>:0
at NoesisGUIPanel.OnEnable () [0x00000] in <filename unknown>:0
Noesis.UIRenderer:Noesis_CreateRenderer(IntPtr)
Noesis.UIRenderer:.ctor(FrameworkElement, Vector2, GameObject)
NoesisGUIPanel:LoadXaml()
NoesisGUIPanel:OnEnable()
I'm forced to .Net 2.0 profile due to a plugin requiring it. When removing the plugin and reverting to .NET2.0 subset everything works. But unfortunately the plugin is needed. Do you know if Noesis should have any problems running with Unity with the desired compatibility level, or do you have an idea what could be causing this?
I'm using Unity 5.2.1f1 and version 1.2.4 of NoesisGui.
ExecutionEngineException: Attempting to call method 'System.Reflection.MonoProperty::GetterAdapterFrame' for which no ahead of time (AOT) code was generated.
at Noesis.Extend.GetPropertyValue_String (IntPtr unityType, Int32 propertyIndex, IntPtr cPtr) [0x00000] in <filename unknown>:0
at Noesis.UIRenderer.Noesis_CreateRenderer (IntPtr root) [0x00000] in <filename unknown>:0
at Noesis.UIRenderer..ctor (Noesis.FrameworkElement content, Vector2 offscreenSize, UnityEngine.GameObject target) [0x00000] in <filename unknown>:0
at NoesisGUIPanel.LoadXaml () [0x00000] in <filename unknown>:0
at NoesisGUIPanel.OnEnable () [0x00000] in <filename unknown>:0
Noesis.UIRenderer:Noesis_CreateRenderer(IntPtr)
Noesis.UIRenderer:.ctor(FrameworkElement, Vector2, GameObject)
NoesisGUIPanel:LoadXaml()
NoesisGUIPanel:OnEnable()
I'm forced to .Net 2.0 profile due to a plugin requiring it. When removing the plugin and reverting to .NET2.0 subset everything works. But unfortunately the plugin is needed. Do you know if Noesis should have any problems running with Unity with the desired compatibility level, or do you have an idea what could be causing this?
I'm using Unity 5.2.1f1 and version 1.2.4 of NoesisGui.
Re: Exception using Noesis and .Net Compability level 2.0 on
This was reported a year ago in the tracker. These were our conclusions:
I have been investigating this and reading the thread:
http://forum.unity3d.com/threads/execut ... hod.43038/
And it seems that the implementation of System.Reflection.GetValue in .NET 2.0 is using generics that are incompatible with AOT, used in iOS. In that thread they propose that instead of using GetValue it can be used:
I have been doing tests and it seems to work, but I don't like it because it is not very efficient. There is an improvement in the link you passed (https://whydoidoit.wordpress.com/2012/0 ... mpilation/) but it requires manually tweaking of the class.
To me, this is a bug in the version of Mono being used by Unity because I don´t see this restriction explained here:
http://developer.xamarin.com/guides/ios ... mitations/
Right now this is affecting to any usage of DataContext. So I see three options:
1. Use .NET 2.0 subset and talk with those 3rdparty developers to use it also? What 3rdparty are those? Do they work properly with iOS?
2. Use .NET 2.0 full and avoid DataContext.
3. Implement something similar to the proposed link or even better, avoid reflection and implement manual functions to return the requires information (a switch with all the implemented properties) implementing an interface for example. This would require changes in NoesisGUI.
I have been investigating this and reading the thread:
http://forum.unity3d.com/threads/execut ... hod.43038/
And it seems that the implementation of System.Reflection.GetValue in .NET 2.0 is using generics that are incompatible with AOT, used in iOS. In that thread they propose that instead of using GetValue it can be used:
Code: Select all
property.GetGetMethod().Invoke(object, arguments);
To me, this is a bug in the version of Mono being used by Unity because I don´t see this restriction explained here:
http://developer.xamarin.com/guides/ios ... mitations/
Right now this is affecting to any usage of DataContext. So I see three options:
1. Use .NET 2.0 subset and talk with those 3rdparty developers to use it also? What 3rdparty are those? Do they work properly with iOS?
2. Use .NET 2.0 full and avoid DataContext.
3. Implement something similar to the proposed link or even better, avoid reflection and implement manual functions to return the requires information (a switch with all the implemented properties) implementing an interface for example. This would require changes in NoesisGUI.
Re: Exception using Noesis and .Net Compability level 2.0 on
Thanks for the reply, a really good answer.
I contacted the 3rd party developers and got instructions to modify the plugin so that it now supports .NET 2.0 Subset.
I contacted the 3rd party developers and got instructions to modify the plugin so that it now supports .NET 2.0 Subset.
Re: Exception using Noesis and .Net Compability level 2.0 on
Thanks! Good to know you are using ".NET 2.0 Subset"
- rinomasaya
- Posts: 1
- Joined:
- Contact:
Who is online
Users browsing this forum: Ahrefs [Bot] and 5 guests