Has anybody actually tried the Ios sample called SimpleApp on an iDevice using MonoTouch? I am using CSLA 4.2.2. The sample works ok on the simulator but it fails on an actual iPad device. I expect the same error would occur on iPhone devices as well. It gets the following error:
System.ExecutionEngineException has been thrown.
Attempting to JIT compile method 'Csla.Core.FieldManager.DefaultPropertyInfoFactory:Create<int> (System.Type,string)' while running with --aot-only.
at Csla.BusinessBase`1[Library.CustomerEdit].RegisterProperty[Int32] (System.Linq.Expressions.Expression`1 propertyLambdaExpression) [0x00000] in <filename unknown>:0
at Library.CustomerEdit..cctor () [0x00000] in <filename unknown>:0
It works on the simulator because JIT works in the Mac environment and hence works in the simulator. MonoTouch does not allow JIT because it is a limitation from Apple on iOS.
The error was occurring when trying to RegisterProperty. So I changed the lines to not use the lambda expression so I didn't have to modify the CSLA framework e.g.
changed
private static PropertyInfo<int> IdProperty = RegisterProperty<int> (c => c.Id);
private static PropertyInfo<int> IdProperty = RegisterProperty<int> (new PropertyInfo<int>("Id"));
Attempting to JIT compile method 'Csla.ReadOnlyBase`1<Csla.Security.UnauthenticatedIdentity>:RegisterProperty<bool> (System.Linq.Expressions.Expression`1<System.Func`2<Csla.Security.UnauthenticatedIdentity, object>>)' while running with --aot-only.
at Csla.Security.CslaIdentityBase`1[Csla.Security.UnauthenticatedIdentity]..cctor () [0x00000] in <filename unknown>:0
The error acutally occurs when getting the CustomerEdit.Name value:
get { return GetProperty (NameProperty); }
Stuart is looking into this.
Copyright (c) Marimer LLC