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
module ApplicationDbContext =
open Microsoft.AspNetCore.Identity
open Microsoft.AspNetCore.Identity.EntityFrameworkCore
open Microsoft.EntityFrameworkCore
open Microsoft.EntityFrameworkCore.Sqlite
open Microsoft.EntityFrameworkCore.Design
type ApplicationDbContext(options : DbContextOptions<ApplicationDbContext>) =
inherit IdentityDbContext(options)
// OPTIONAL. seed the database with some initial roles.
override __.OnModelCreating (modelBuilder : ModelBuilder) =
base.OnModelCreating(modelBuilder)
modelBuilder.Entity<IdentityRole>().HasData(
[|
IdentityRole(Name = "admin", NormalizedName = "ADMIN")
IdentityRole(Name = "user", NormalizedName = "USER")
|]) |> ignore
type ApplicationDbContextFactory() =
interface IDesignTimeDbContextFactory<ApplicationDbContext> with
member __.CreateDbContext (args: string[]) =
let optionsBuilder = new DbContextOptionsBuilder<ApplicationDbContext>()
optionsBuilder.UseSqlite("Data Source=./Data/Identity.db") |> ignore
new ApplicationDbContext(optionsBuilder.Options)
System.MissingMethodException: Method not found: 'System.String Microsoft.EntityFrameworkCore.Design.ICSharpHelper.Fragment(Microsoft.EntityFrameworkCore.Design.MethodCallCodeFragment, System.String, Boolean)'.
at EntityFrameworkCore.FSharp.EFCoreFSharpServices.Microsoft.EntityFrameworkCore.Design.IDesignTimeServices.ConfigureDesignTimeServices(IServiceCollection services)
at Microsoft.EntityFrameworkCore.Design.Internal.DesignTimeServicesBuilder.ConfigureDesignTimeServices(Type designTimeServicesType, IServiceCollection services)
at Microsoft.EntityFrameworkCore.Design.Internal.DesignTimeServicesBuilder.ConfigureReferencedServices(IServiceCollection services, String provider)
at Microsoft.EntityFrameworkCore.Design.Internal.DesignTimeServicesBuilder.CreateServiceCollection(DbContext context)
at Microsoft.EntityFrameworkCore.Design.Internal.DesignTimeServicesBuilder.Build(DbContext context)
at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.AddMigration(String name, String outputDir, String contextType, String namespace)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.AddMigrationImpl(String name, String outputDir, String contextType, String namespace)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.AddMigration.<>c__DisplayClass0_0.<.ctor>b__0()
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.<>c__DisplayClass3_0`1.b__0()
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
Method not found: 'System.String Microsoft.EntityFrameworkCore.Design.ICSharpHelper.Fragment(Microsoft.EntityFrameworkCore.Design.MethodCallCodeFragment, System.String, Boolean)'.
Using .net 8 and EF Core 6.0.7
Part of my
Program.fs
My ApplicationDbContext:
And my nuget packages:
And get this error when I try to add a migration:
Link to repo
https://github.com/blfuentes/SleepTracker/tree/identity-implementation
Tried following the steps here and same issue...
https://github.com/efcore/EFCore.FSharp/blob/master/GETTING_STARTED.md
The text was updated successfully, but these errors were encountered: