Error: Unable to build IHost No DbContext named ‘PersistedGrantDbContext‘ was found.

IdentityServer4 data migration error: surprisingly Apollo appsettings.json configuration problem!

PM> dotnet ef migrations add InitialIdentityServerPersistedGrantDbMigration -c PersistedGrantDbContext -o Data/Migrations/IdentityServer/PersistedGrantDb –project MicroService.IdentityServer
Build started…
Build succeeded.
An error occurred while accessing the Microsoft.Extensions.Hosting services. Continuing without the application service provider. Error: Unable to build IHost
No DbContext named ‘PersistedGrantDbContext’ was found.
PM> dotnet ef migrations add InitialIdentityServerPersistedGrantDbMigration -c PersistedGrantDbContext -o Data/Migrations/IdentityServer/PersistedGrantDb –project MicroService.IdentityServer


Read More: