You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a Model with a long id Property and 9 double Properties ( or more )
public class Model2
{
public long id { get; set; }
public double yolo1 { get; set; }
public double yolo2 { get; set; }
public double yolo3 { get; set; }
public double yolo4 { get; set; }
public double yolo5 { get; set; }
public double yolo6 { get; set; }
public double yolo7 { get; set; }
public double yolo8 { get; set; }
public double yolo9 { get; set; }
}
Create a DbContext Class
public class AppDbContext : DbContext
{
public DbSet<Model2> model2Set { get; set; }
public AppDbContext()
{
SQLitePCL.Batteries_V2.Init();
Database.OpenConnection();
Database.EnsureCreated();
}
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseSqlite(new SqliteConnectionStringBuilder("Data Source=" + Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "YOLO.db")) { Password = "1324" }.ToString());
}
}
Try to Add Model2
using(AppDbContext context = new AppDbContext())
{
var model2 = new Model2();
context.model2Set.Add(model2);
context.SaveChanges();
}
Run the app on a iOS device. (iPhone 11 pro max ios 14.6)
2021-07-28 10:31:24.609 App2[5016:1699479]
Unhandled Exception:
System.ExecutionEngineException: Attempting to JIT compile method '(wrapper runtime-invoke) object <Module>:runtime_invoke_void__this___long_double_double_double_double_double_double_double_double_double (object,intptr,intptr,intptr)' while running in aot-only mode. See https://docs.microsoft.com/xamarin/ios/internals/limitations for more information.
at (wrapper managed-to-native) System.Reflection.RuntimeConstructorInfo.InternalInvoke(System.Reflection.RuntimeConstructorInfo,object,object[],System.Exception&)
at System.Reflection.RuntimeConstructorInfo.InternalInvoke (System.Object obj, System.Object[] parameters, System.Boolean wrapExceptions) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs:936
--- End of stack trace from previous location where exception was thrown ---
at System.Linq.Expressions.Interpreter.ExceptionHelpers.UnwrapAndRethrow (System.Reflection.TargetInvocationException exception) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/external/corefx/src/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/Utilities.cs:172
at System.Linq.Expressions.Interpreter.NewInstruction.Run (System.Linq.Expressions.Interpreter.InterpretedFrame frame) [0x00026] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/external/corefx/src/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/NewInstruction.cs:39
at System.Linq.Expressions.Interpreter.Interpreter.Run (System.Linq.Expressions.Interpreter.InterpretedFrame frame) [0x00015] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/external/corefx/src/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/Interpreter.cs:63
at System.Linq.Expressions.Interpreter.LightLambda.Run1[T0,TRet] (T0 arg0) [0x0001c] in <26bd496943a145e18f2cd8379c502c52>:0
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry+OriginalValues..ctor (Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry entry) [0x00011] in <490630622de1432a8c452c33119e98b5>:0
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry.EnsureOriginalValues () [0x0000d] in <490630622de1432a8c452c33119e98b5>:0
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntrySubscriber.SnapshotAndSubscribe (Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry entry) [0x0000f] in <490630622de1432a8c452c33119e98b5>:0
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.StartTracking (Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry entry) [0x0008c] in <490630622de1432a8c452c33119e98b5>:0
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry.SetEntityState (Microsoft.EntityFrameworkCore.EntityState oldState, Microsoft.EntityFrameworkCore.EntityState newState, System.Boolean acceptChanges, System.Boolean modifyProperties) [0x0015d] in <490630622de1432a8c452c33119e98b5>:0
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry.SetEntityState (Microsoft.EntityFrameworkCore.EntityState entityState, System.Boolean acceptChanges, System.Boolean modifyProperties, System.Nullable`1[T] forceStateWhenUnknownKey) [0x00039] in <490630622de1432a8c452c33119e98b5>:0
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityGraphAttacher.PaintAction (Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntryGraphNode`1[TState] node) [0x0006d] in <490630622de1432a8c452c33119e98b5>:0
at (wrapper other) System.Object.gsharedvt_out()
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityEntryGraphIterator.TraverseGraph[TState] (Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntryGraphNode`1[TState] node, System.Func`2[T,TResult] handleNode) [0x00000] in <490630622de1432a8c452c33119e98b5>:0
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityGraphAttacher.AttachGraph (Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry rootEntry, Microsoft.EntityFrameworkCore.EntityState targetState, Microsoft.EntityFrameworkCore.EntityState storeGeneratedWithKeySetTargetState, System.Boolean forceStateWhenUnknownKey) [0x00017] in <490630622de1432a8c452c33119e98b5>:0
at Microsoft.EntityFrameworkCore.Internal.InternalDbSet`1[TEntity].SetEntityState (Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry entry, Microsoft.EntityFrameworkCore.EntityState entityState) [0x00018] in <490630622de1432a8c452c33119e98b5>:0
at Microsoft.EntityFrameworkCore.Internal.InternalDbSet`1[TEntity].Add (TEntity entity) [0x0000f] in <490630622de1432a8c452c33119e98b5>:0
at App2.Application.Main (System.String[] args) [0x00028] in C:\source\repos\App2\App2\Main.cs:18
Steps to Reproduce
Pls. Check out the Example Project
https://github.com/spectraflex/XamarionIosEntityFrameworkCoreBug
Expected Behavior
context.model2Set.Add(model2);
should work
Actual Behavior
context.model2Set.Add(model2);
Environment
Build Logs (Exception)
Example Project (If Possible)
https://github.com/spectraflex/XamarionIosEntityFrameworkCoreBug
The text was updated successfully, but these errors were encountered: