An error occurred while calling method 'ConfigureServices' on startup class 'Startup'. Consider using IDbContextFactory to override the initialization of the DbContext at design-time. Error: The method or operation is not implemented.
I'm want to use EF for COnfiguration data.
My statup.cs
namespace IdentityServer
{
public class Startup
{
{
services.AddMvc();
var connectionString = @"Data Source=CR08186\\sqlexpress;Initial Catalog=IdentityServer;Persist Security Info=True;User ID=sa;Password=MsSql2008";
var migrationsAssembly = typeof(Startup).GetTypeInfo().Assembly.GetName().Name;
// configure identity server with in-memory users, but EF stores for clients and resources
services.AddIdentityServer()
.AddTemporarySigningCredential()
.AddTestUsers(Config.GetUsers())
.AddConfigurationStore(builder =>
builder.UseSqlServer(connectionString, options =>
options.MigrationsAssembly(migrationsAssembly)))
.AddOperationalStore(builder =>
builder.UseSqlServer(connectionString, options =>
options.MigrationsAssembly(migrationsAssembly)));
}
}
from cmd running dotnet ef migrations add InitialIdentityServerMigration -c PersistedGrantDbContext and dotnet ef migrations add InitialIdentityServerPersistedGrantDbMigration -c PersistedGrantDbContext -o Data/Migrations/IdentityServer/PersistedGrantDb
and have an error
An error occurred while calling method 'ConfigureServices' on startup class 'Startup'. Consider using IDbContextFactory to override the initialization of the DbContext at design-time. Error: The method or operation is not implemented. No DbContext named 'PersistedGrantDbContext' was found.
Any help would be appreciated!
@AlexGnatuyk What versions of .NET Core, ASP.NET Core, and EF Core are you using?
@ajcvickers I'm using .NET Core 1.1, ASP.NET Core 1.1.x, EF Core 1.1.x