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
This works great when running from debug but when I deploy to Azure I get the exception below when creating the context from the factory. My context only has one simple entity with no date fields. Any way around this?
Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
Unhandled exception rendering component: Could not find method 'AddYears' on type 'System.DateOnly'
System.InvalidOperationException: Could not find method 'AddYears' on type 'System.DateOnly'
...
at SqliteWasmHelper.SqliteWasmDbContextFactory1[[EPOD_POC.Client.BrowserData.RouteContext, EPOD_POC.Client, Version=1.0.0.34966, Culture=neutral, PublicKeyToken=null]].GetFilename()
at SqliteWasmHelper.SqliteWasmDbContextFactory1.d__19[[EPOD_POC.Client.BrowserData.RouteContext, EPOD_POC.Client, Version=1.0.0.34966, Culture=neutral, PublicKeyToken=null]].MoveNext()
at SqliteWasmHelper.SqliteWasmDbContextFactory1.d__17[[EPOD_POC.Client.BrowserData.RouteContext, EPOD_POC.Client, Version=1.0.0.34966, Culture=neutral, PublicKeyToken=null]].MoveNext()
at SqliteWasmHelper.SqliteWasmDbContextFactory1.d__14[[EPOD_POC.Client.BrowserData.RouteContext, EPOD_POC.Client, Version=1.0.0.34966, Culture=neutral, PublicKeyToken=null]].MoveNext()
at EPOD_POC.Client.Pages.Home.CallSqlite()
at EPOD_POC.Client.Pages.Home.b__35_4(MouseEventArgs e)
Entity:
public class TestEntity
{
public int Id { get; set; }
public string NothingButAString { get; set; }
}
Context:
public class RouteContext : DbContext
{
public RouteContext(DbContextOptions<RouteContext> opts) : base(opts)
{
}
public DbSet<TestEntity> TestEntities { get; set; }
}
/// FIXME: This is required for EF Core 6.0 as it is not compatible with trimming.
///
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)]
private static Type _keepDateOnly = typeof(DateOnly);
}
This works great when running from debug but when I deploy to Azure I get the exception below when creating the context from the factory. My context only has one simple entity with no date fields. Any way around this?
Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
Unhandled exception rendering component: Could not find method 'AddYears' on type 'System.DateOnly'
System.InvalidOperationException: Could not find method 'AddYears' on type 'System.DateOnly'
...
at SqliteWasmHelper.SqliteWasmDbContextFactory1[[EPOD_POC.Client.BrowserData.RouteContext, EPOD_POC.Client, Version=1.0.0.34966, Culture=neutral, PublicKeyToken=null]].GetFilename()
at SqliteWasmHelper.SqliteWasmDbContextFactory1.d__19[[EPOD_POC.Client.BrowserData.RouteContext, EPOD_POC.Client, Version=1.0.0.34966, Culture=neutral, PublicKeyToken=null]].MoveNext()
at SqliteWasmHelper.SqliteWasmDbContextFactory1.d__17[[EPOD_POC.Client.BrowserData.RouteContext, EPOD_POC.Client, Version=1.0.0.34966, Culture=neutral, PublicKeyToken=null]].MoveNext()
at SqliteWasmHelper.SqliteWasmDbContextFactory1.d__14[[EPOD_POC.Client.BrowserData.RouteContext, EPOD_POC.Client, Version=1.0.0.34966, Culture=neutral, PublicKeyToken=null]].MoveNext()
at EPOD_POC.Client.Pages.Home.CallSqlite()
at EPOD_POC.Client.Pages.Home.b__35_4(MouseEventArgs e)
Entity:
Context:
Program.cs
builder.Services.AddSqliteWasmDbContextFactory<RouteContext>(opts => opts.UseSqlite("Data Source=Route.sqlite3"));
Component code behind (note I get the exception when only creating the context):
The text was updated successfully, but these errors were encountered: